flakytest.dev anze3db fedidevs
Tests / announcements/tests.py

TestPostAnnouncements::test_respects_visibility

First seen 1 month, 1 week ago in 0c23747
CI github-actions:test 13 runs
Average
15 ms
median 15 ms
max 25 ms
Phases
Setup 1 ms Call 13 ms Teardown 0.57 ms
Categories
Database 11 ms Factories 0.15 ms Other (Unsampled, pytest, Libraries, Mocking) 4 ms

10 database queries per run

Needs 51 KB of memory (max 72 KB)

Duration per run

Where the time goes

Latest run in ci:github-actions:test, 2 weeks ago · open run
Show pytest frames
call7 ms91.2%
TestPostAnnouncements.test_respects_visibilityannouncements/tests.py:672 ms30.4%
TestPostAnnouncements._run_atannouncements/tests.py:42 call_command("postannouncements", *([] if dry_run else ["--no-dry-run"]))2 ms20.3%
call_commanddjango/core/management/__init__.py:1952 ms20.3%
RichCommand.executedjango_rich/management/__init__.py:342 ms20.3%
BaseCommand.executedjango/core/management/base.py:4662 ms20.3%
Command.handleannouncements/management/commands/postannouncements.py:26 due = list(Announcement.objects.filter(posted_at__isnull=True, post_at__lte=timezone.now()))0.83 ms10.1%
QuerySet.__iter__django/db/models/query.py:4390.83 ms10.1%
QuerySet._fetch_alldjango/db/models/query.py:22620.83 ms10.1%
ModelIterable.__iter__django/db/models/query.py:1030.83 ms10.1%
SQLCompiler.execute_sqldjango/db/models/sql/compiler.py:16250.83 ms10.1%
CursorWrapper.executedjango/db/backends/utils.py:790.83 ms10.1%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:920.83 ms10.1%
CursorWrapper._executedjango/db/backends/utils.py:1050.83 ms10.1%
Cursor.executepsycopg/cursor.py:1130.83 ms10.1%
Connection.waitpsycopg/connection.py:4950.83 ms10.1%
BaseCursor._execute_genpsycopg/_cursor_base.py:2060.83 ms10.1%
BaseCursor._maybe_prepare_genpsycopg/_cursor_base.py:2860.83 ms10.1%
ClientCursorMixin._execute_sendpsycopg/client_cursor.py:780.83 ms10.1%
Command.handleannouncements/management/commands/postannouncements.py:64 announcement.save(update_fields=["posted_at", "post_url", "error"])0.83 ms10.1%
Model.savedjango/db/models/base.py:9040.83 ms10.1%
Model.save_basedjango/db/models/base.py:9960.83 ms10.1%
Model._save_tabledjango/db/models/base.py:11400.83 ms10.1%
Model._do_updatedjango/db/models/base.py:12440.83 ms10.1%
QuerySet._updatedjango/db/models/query.py:14480.83 ms10.1%
SQLUpdateCompiler.execute_returning_sqldjango/db/models/sql/compiler.py:21500.83 ms10.1%
SQLUpdateCompiler.execute_sqldjango/db/models/sql/compiler.py:21210.83 ms10.1%
SQLCompiler.execute_sqldjango/db/models/sql/compiler.py:16250.83 ms10.1%
CursorWrapper.executedjango/db/backends/utils.py:790.83 ms10.1%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:920.83 ms10.1%
CursorWrapper._executedjango/db/backends/utils.py:1050.83 ms10.1%
Cursor.executepsycopg/cursor.py:1130.83 ms10.1%
Connection.waitpsycopg/connection.py:4950.83 ms10.1%
BaseCursor._execute_genpsycopg/_cursor_base.py:2060.83 ms10.1%
BaseCursor._maybe_prepare_genpsycopg/_cursor_base.py:2860.83 ms10.1%
ClientCursorMixin._execute_sendpsycopg/client_cursor.py:780.83 ms10.1%
TestPostAnnouncements._run_atannouncements/tests.py:38 client.status_post.return_value = {"url": "https://fosstodon.org/@fedidevs/1"}0.83 ms10.1%
NonCallableMock.__getattr__<stdlib>/unittest/mock.py:7170.83 ms10.1%
NonCallableMock._get_child_mock<stdlib>/unittest/mock.py:10970.83 ms10.1%
NonCallableMock.__new__<stdlib>/unittest/mock.py:4600.83 ms10.1%
TestPostAnnouncements.setUpannouncements/tests.py:18 self.due = baker.make(0.83 ms10.1%
makemodel_bakery/baker.py:1750.83 ms10.1%
Baker.makemodel_bakery/baker.py:4540.83 ms10.1%
Baker._makemodel_bakery/baker.py:5420.83 ms10.1%
Baker.instancemodel_bakery/baker.py:6350.83 ms10.1%
Baker._handle_generic_foreign_keysmodel_bakery/baker.py:9000.83 ms10.1%
TestPostAnnouncements.setUpannouncements/tests.py:25 self.not_due = baker.make(0.83 ms10.1%
makemodel_bakery/baker.py:1750.83 ms10.1%
Baker.makemodel_bakery/baker.py:4540.83 ms10.1%
Baker._makemodel_bakery/baker.py:5420.83 ms10.1%
Baker.instancemodel_bakery/baker.py:6590.83 ms10.1%
Model.savedjango/db/models/base.py:9040.83 ms10.1%
Model.save_basedjango/db/models/base.py:9960.83 ms10.1%
Model._save_tabledjango/db/models/base.py:11990.83 ms10.1%
Model._do_insertdjango/db/models/base.py:12510.83 ms10.1%
BaseManager._get_queryset_methods.<locals>.create_method.<locals>.manager_methoddjango/db/models/manager.py:870.83 ms10.1%
QuerySet._insertdjango/db/models/query.py:21410.83 ms10.1%
SQLInsertCompiler.execute_sqldjango/db/models/sql/compiler.py:19360.83 ms10.1%
CursorWrapper.executedjango/db/backends/utils.py:790.83 ms10.1%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:920.83 ms10.1%
CursorWrapper._executedjango/db/backends/utils.py:1050.83 ms10.1%
Cursor.executepsycopg/cursor.py:1130.83 ms10.1%
Connection.waitpsycopg/connection.py:4950.83 ms10.1%
BaseCursor._execute_genpsycopg/_cursor_base.py:2050.83 ms10.1%
BaseCursor._convert_querypsycopg/_cursor_base.py:4650.83 ms10.1%
PostgresClientQuery.convertpsycopg/_queries.py:2890.83 ms10.1%
PostgresClientQuery.dumppsycopg/_queries.py:2990.83 ms10.1%
PostgresClientQuery.dump.<locals>.<genexpr>psycopg/_queries.py:3000.83 ms10.1%
TestPostAnnouncements.test_respects_visibilityannouncements/tests.py:65 self.due.save()0.83 ms10.1%
Model.savedjango/db/models/base.py:9040.83 ms10.1%
Model.save_basedjango/db/models/base.py:9960.83 ms10.1%
Model._save_tabledjango/db/models/base.py:11400.83 ms10.1%
Model._do_updatedjango/db/models/base.py:12440.83 ms10.1%
QuerySet._updatedjango/db/models/query.py:14480.83 ms10.1%
SQLUpdateCompiler.execute_returning_sqldjango/db/models/sql/compiler.py:21500.83 ms10.1%
SQLUpdateCompiler.execute_sqldjango/db/models/sql/compiler.py:21210.83 ms10.1%
SQLCompiler.execute_sqldjango/db/models/sql/compiler.py:16120.83 ms10.1%
SQLUpdateCompiler.as_sqldjango/db/models/sql/compiler.py:20980.83 ms10.1%
SQLCompiler.compiledjango/db/models/sql/compiler.py:5790.83 ms10.1%
WhereNode.as_sqldjango/db/models/sql/where.py:1510.83 ms10.1%
SQLCompiler.compiledjango/db/models/sql/compiler.py:5790.83 ms10.1%
TransactionTestCase._post_teardowndjango/test/testcases.py:1243 self._fixture_teardown()0.83 ms10.1%
TestCase._fixture_teardowndjango/test/testcases.py:14980.83 ms10.1%
DatabaseWrapper.check_constraintsdjango/db/backends/postgresql/base.py:4940.83 ms10.1%
async_unsafe.<locals>.decorator.<locals>.innerdjango/utils/asyncio.py:260.83 ms10.1%
BaseDatabaseWrapper.cursordjango/db/backends/base/base.py:3200.83 ms10.1%
BaseDatabaseWrapper._cursordjango/db/backends/base/base.py:2960.83 ms10.1%
Estimated from 9 samples; phase durations are exact. Frames from pytest and pluggy are hidden .

Hot lines in your code

announcements/tests.py:18
self.due = baker.make(
TestPostAnnouncements.setUp · Factories
0.82 ms
announcements/tests.py:25
self.not_due = baker.make(
TestPostAnnouncements.setUp · Database
0.82 ms
announcements/tests.py:65
self.due.save()
TestPostAnnouncements.test_respects_visibility · Database
0.82 ms
announcements/tests.py:38
client.status_post.return_value = {"url": "https://fosstodon.org/@fedidevs/1"}
TestPostAnnouncements._run_at · Mocking
0.82 ms
announcements/management/commands/postannouncements.py:26
due = list(Announcement.objects.filter(posted_at__isnull=True, post_at__lte=timezone.now()))
Command.handle · Database
0.82 ms
announcements/management/commands/postannouncements.py:64
announcement.save(update_fields=["posted_at", "post_url", "error"])
Command.handle · Database
0.82 ms

Fixtures

Exact setup time
_template_string_if_invalid_marker function 0.03 ms
_dj_autoclear_mailbox function 0.03 ms
_django_db_marker function 0.03 ms
_django_isolate_apps function 0.03 ms
_django_set_urlconf function 0.02 ms
_live_server_helper function 0.02 ms
_django_clear_site_cache function 0.02 ms
monkeypatch function 0.01 ms

Database

10 queries · 3 ms
No repeated queries.

Biggest pieces of work

call test body
announcements/tests.py:65
3 ms
call pytest internals 2 ms
call setUp
announcements/tests.py:18
2 ms
call _post_teardown
django/test/testcases.py:1243
0.82 ms

Reliability

14 results · 0 CI failures · 0 local failures

This test hasn't failed recently.

History

Latest 14 results, oldest first in the strip
When Environment Outcome Duration Commit
2 weeks ago CI github-actions:test passed 8 ms 28600ed main Profile
2 weeks, 5 days ago CI github-actions:test passed 16 ms 600b717 main Profile
2 weeks, 6 days ago CI github-actions:test passed 11 ms c28a326 main Profile
3 weeks ago CI github-actions:test passed 12 ms 9b8826a main Profile
3 weeks ago CI github-actions:test passed 13 ms 4f01055 main Profile
1 month ago CI github-actions:test passed 18 ms 8ab642e main Profile
1 month ago CI github-actions:test passed 25 ms 9b75244 main Profile
1 month ago CI github-actions:test passed 10 ms 9603516 main Profile
1 month, 1 week ago CI github-actions:test passed 21 ms 615a272 main Profile
1 month, 1 week ago CI github-actions:test passed 11 ms d923a46 main Profile
1 month, 1 week ago CI github-actions:test passed 15 ms 82997f8 main Profile
1 month, 1 week ago CI github-actions:test passed 15 ms 623aa3e main Profile
1 month, 1 week ago CI github-actions:test passed 20 ms ab6465a main Profile
1 month, 1 week ago CI github-actions:test passed 9 ms 0c23747 main Run