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

TestSyncAnnouncements::test_leaves_already_posted_announcements_untouched

First seen 15 hours ago in 0c23747
CI github-actions:test 4 runs
Average
42 ms
median 44 ms
max 57 ms
Phases
Setup 2 ms Call 40 ms Teardown 0.31 ms
Categories
Database 34 ms Factories 0.82 ms App code 0.25 ms Other (Libraries, pytest, Mocking, Unsampled, ...) 7 ms

17 database queries per run

Needs 35 KB of memory (max 44 KB)

Duration per run

Where the time goes

Latest run in ci:github-actions:test, 10 hours ago · open run
Hide pytest frames
setup1 ms5.4%
CallInfo.from_call_pytest/runner.py:3611 ms5.4%
call_and_report.<locals>.<lambda>_pytest/runner.py:2501 ms5.4%
HookCaller.__call__pluggy/_hooks.py:5121 ms5.4%
PluginManager._hookexecpluggy/_manager.py:1201 ms5.4%
_multicallpluggy/_callers.py:1211 ms5.4%
pytest_runtest_setup_pytest/runner.py:1701 ms5.4%
SetupState.setup_pytest/runner.py:5361 ms5.4%
TestCaseFunction.setup_pytest/unittest.py:2481 ms5.4%
Function.setup_pytest/python.py:17101 ms5.4%
TopRequest._fillfixtures_pytest/fixtures.py:8061 ms5.4%
FixtureRequest.getfixturevalue_pytest/fixtures.py:6301 ms5.4%
FixtureRequest._get_active_fixturedef_pytest/fixtures.py:7261 ms5.4%
FixtureDef.execute_pytest/fixtures.py:12321 ms5.4%
call20 ms93.4%
CallInfo.from_call_pytest/runner.py:36120 ms93.4%
call_and_report.<locals>.<lambda>_pytest/runner.py:25020 ms93.4%
HookCaller.__call__pluggy/_hooks.py:51220 ms93.4%
PluginManager._hookexecpluggy/_manager.py:12020 ms93.4%
_multicallpluggy/_callers.py:12119 ms88.7%
pytest_runtest_call_pytest/runner.py:18419 ms88.7%
_django_setup_unittest.<locals>.non_debugging_runtestpytest_django/plugin.py:61419 ms88.7%
SimpleTestCase.__call__django/test/testcases.py:31419 ms88.7%
SimpleTestCase._setup_and_calldjango/test/testcases.py:36918 ms84.0%
TestCase.__call__<stdlib>/unittest/case.py:74718 ms84.0%
TestCase.run<stdlib>/unittest/case.py:69118 ms84.0%
TestCase._callTestMethod<stdlib>/unittest/case.py:63718 ms84.0%
TestSyncAnnouncements.test_leaves_already_posted_announcements_untouchedconfs/tests.py:10277 ms32.7%
TestSyncAnnouncements._syncconfs/tests.py:937 call_command("syncannouncements")6 ms28.0%
call_commanddjango/core/management/__init__.py:1956 ms28.0%
RichCommand.executedjango_rich/management/__init__.py:346 ms28.0%
BaseCommand.executedjango/core/management/base.py:4666 ms28.0%
Command.handleconfs/management/commands/syncannouncements.py:13 sync_upcoming(Conference, Announcement, timezone.now().date())5 ms23.3%
sync_upcomingconfs/conference_announcements.py:1083 ms14.0%
sync_conferenceconfs/conference_announcements.py:85 announcement = announcement_model.objects.create(2 ms9.3%
BaseManager._get_queryset_methods.<locals>.create_method.<locals>.manager_methoddjango/db/models/manager.py:872 ms9.3%
QuerySet.createdjango/db/models/query.py:7362 ms9.3%
Model.savedjango/db/models/base.py:9042 ms9.3%
Model.save_basedjango/db/models/base.py:9962 ms9.3%
Model._save_tabledjango/db/models/base.py:11992 ms9.3%
Model._do_insertdjango/db/models/base.py:12512 ms9.3%
BaseManager._get_queryset_methods.<locals>.create_method.<locals>.manager_methoddjango/db/models/manager.py:872 ms9.3%
QuerySet._insertdjango/db/models/query.py:21412 ms9.3%
SQLInsertCompiler.execute_sqldjango/db/models/sql/compiler.py:19362 ms9.3%
CursorWrapper.executedjango/db/backends/utils.py:792 ms9.3%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:922 ms9.3%
QueryTracker._django_wrapperflakytest/profiling/dbtrack.py:1001 ms4.7%
CursorWrapper._executedjango/db/backends/utils.py:1051 ms4.7%
Cursor.executepsycopg/cursor.py:1131 ms4.7%
Connection.waitpsycopg/connection.py:4951 ms4.7%
BaseCursor._execute_genpsycopg/_cursor_base.py:2061 ms4.7%
BaseCursor._maybe_prepare_genpsycopg/_cursor_base.py:2861 ms4.7%
ClientCursorMixin._execute_sendpsycopg/client_cursor.py:781 ms4.7%
QueryTracker._django_wrapperflakytest/profiling/dbtrack.py:1021 ms4.7%
QueryStats.addflakytest/profiling/dbtrack.py:381 ms4.7%
normalize_sqlflakytest/profiling/dbtrack.py:251 ms4.7%
sync_conferenceconfs/conference_announcements.py:861 ms4.7%
content_forconfs/conference_announcements.py:70 body = templates[index].format(name=conference.name) + f"\n{url}"1 ms4.7%
sync_upcomingconfs/conference_announcements.py:104 upcoming = conference_model.objects.filter(1 ms4.7%
BaseManager._get_queryset_methods.<locals>.create_method.<locals>.manager_methoddjango/db/models/manager.py:871 ms4.7%
QuerySet.filterdjango/db/models/query.py:16761 ms4.7%
QuerySet._filter_or_excludedjango/db/models/query.py:16941 ms4.7%
QuerySet._filter_or_exclude_inplacedjango/db/models/query.py:17041 ms4.7%
Query.add_qdjango/db/models/sql/query.py:16811 ms4.7%
Query._add_qdjango/db/models/sql/query.py:17131 ms4.7%
Query.build_filterdjango/db/models/sql/query.py:16111 ms4.7%
Query._get_coldjango/db/models/sql/query.py:4561 ms4.7%
Field.get_coldjango/db/models/fields/__init__.py:5771 ms4.7%
sync_upcomingconfs/conference_announcements.py:107 for conference in upcoming:1 ms4.7%
QuerySet.__iter__django/db/models/query.py:4391 ms4.7%
QuerySet._fetch_alldjango/db/models/query.py:22621 ms4.7%
ModelIterable.__iter__django/db/models/query.py:1031 ms4.7%
SQLCompiler.execute_sqldjango/db/models/sql/compiler.py:16251 ms4.7%
CursorWrapper.executedjango/db/backends/utils.py:791 ms4.7%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:921 ms4.7%
QueryTracker._django_wrapperflakytest/profiling/dbtrack.py:1001 ms4.7%
CursorWrapper._executedjango/db/backends/utils.py:1051 ms4.7%
Cursor.executepsycopg/cursor.py:1131 ms4.7%
Connection.waitpsycopg/connection.py:4951 ms4.7%
BaseCursor._execute_genpsycopg/_cursor_base.py:2061 ms4.7%
BaseCursor._maybe_prepare_genpsycopg/_cursor_base.py:2861 ms4.7%
ClientCursorMixin._execute_sendpsycopg/client_cursor.py:781 ms4.7%
Command.handleconfs/management/commands/syncannouncements.py:14 self.console.print("Done syncing announcements 🎉")1 ms4.7%
Console.printrich/console.py:17161 ms4.7%
Console.optionsrich/console.py:9931 ms4.7%
Console.sizerich/console.py:10241 ms4.7%
TestSyncAnnouncements._syncconfs/tests.py:936 with mock.patch("confs.management.commands.syncannouncements.timezone.now", return_value=self.NOW):1 ms4.7%
_patch.__enter__<stdlib>/unittest/mock.py:15681 ms4.7%
MagicMixin.__init__<stdlib>/unittest/mock.py:21821 ms4.7%
MagicMixin._mock_set_magics<stdlib>/unittest/mock.py:22051 ms4.7%
TestSyncAnnouncements.test_leaves_already_posted_announcements_untouchedconfs/tests.py:1036 self._sync()4 ms18.7%
TestSyncAnnouncements._syncconfs/tests.py:937 call_command("syncannouncements")3 ms14.0%
call_commanddjango/core/management/__init__.py:1953 ms14.0%
RichCommand.executedjango_rich/management/__init__.py:343 ms14.0%
BaseCommand.executedjango/core/management/base.py:4663 ms14.0%
Command.handleconfs/management/commands/syncannouncements.py:13 sync_upcoming(Conference, Announcement, timezone.now().date())3 ms14.0%
sync_upcomingconfs/conference_announcements.py:107 for conference in upcoming:2 ms9.3%
QuerySet.__iter__django/db/models/query.py:4392 ms9.3%
QuerySet._fetch_alldjango/db/models/query.py:22622 ms9.3%
ModelIterable.__iter__django/db/models/query.py:1032 ms9.3%
SQLCompiler.execute_sqldjango/db/models/sql/compiler.py:16252 ms9.3%
CursorWrapper.executedjango/db/backends/utils.py:792 ms9.3%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:922 ms9.3%
QueryTracker._django_wrapperflakytest/profiling/dbtrack.py:1002 ms9.3%
CursorWrapper._executedjango/db/backends/utils.py:1052 ms9.3%
Cursor.executepsycopg/cursor.py:1132 ms9.3%
Connection.waitpsycopg/connection.py:4952 ms9.3%
sync_upcomingconfs/conference_announcements.py:1081 ms4.7%
sync_conferenceconfs/conference_announcements.py:94 announcement.save(update_fields=["content", "post_at"])1 ms4.7%
Model.savedjango/db/models/base.py:9041 ms4.7%
Model.save_basedjango/db/models/base.py:9961 ms4.7%
Model._save_tabledjango/db/models/base.py:11401 ms4.7%
Model._do_updatedjango/db/models/base.py:12441 ms4.7%
QuerySet._updatedjango/db/models/query.py:14481 ms4.7%
SQLUpdateCompiler.execute_returning_sqldjango/db/models/sql/compiler.py:21501 ms4.7%
SQLUpdateCompiler.execute_sqldjango/db/models/sql/compiler.py:21211 ms4.7%
SQLCompiler.execute_sqldjango/db/models/sql/compiler.py:16251 ms4.7%
CursorWrapper.executedjango/db/backends/utils.py:791 ms4.7%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:921 ms4.7%
QueryTracker._django_wrapperflakytest/profiling/dbtrack.py:1001 ms4.7%
CursorWrapper._executedjango/db/backends/utils.py:1051 ms4.7%
Cursor.executepsycopg/cursor.py:1131 ms4.7%
Connection.waitpsycopg/connection.py:4951 ms4.7%
TestSyncAnnouncements._syncconfs/tests.py:936 with mock.patch("confs.management.commands.syncannouncements.timezone.now", return_value=self.NOW):1 ms4.7%
_patch.__enter__<stdlib>/unittest/mock.py:15681 ms4.7%
MagicMixin.__init__<stdlib>/unittest/mock.py:21821 ms4.7%
MagicMixin._mock_set_magics<stdlib>/unittest/mock.py:22051 ms4.7%
TestSyncAnnouncements.test_leaves_already_posted_announcements_untouchedconfs/tests.py:10262 ms9.3%
TestSyncAnnouncements._conferenceconfs/tests.py:933 return baker.make(Conference, **defaults)2 ms9.3%
makemodel_bakery/baker.py:1752 ms9.3%
Baker.makemodel_bakery/baker.py:4542 ms9.3%
Baker._makemodel_bakery/baker.py:5291 ms4.7%
Baker.generate_valuemodel_bakery/baker.py:10191 ms4.7%
gen_stringmodel_bakery/random_gen.py:2701 ms4.7%
gen_string.<locals>.<genexpr>model_bakery/random_gen.py:2701 ms4.7%
Random.choice<stdlib>/random.py:3541 ms4.7%
Random._randbelow_with_getrandbits<stdlib>/random.py:2481 ms4.7%
Baker._makemodel_bakery/baker.py:5421 ms4.7%
Baker.instancemodel_bakery/baker.py:6591 ms4.7%
Model.savedjango/db/models/base.py:9041 ms4.7%
Model.save_basedjango/db/models/base.py:9961 ms4.7%
Model._save_tabledjango/db/models/base.py:11991 ms4.7%
Model._do_insertdjango/db/models/base.py:12511 ms4.7%
BaseManager._get_queryset_methods.<locals>.create_method.<locals>.manager_methoddjango/db/models/manager.py:871 ms4.7%
QuerySet._insertdjango/db/models/query.py:21411 ms4.7%
SQLInsertCompiler.execute_sqldjango/db/models/sql/compiler.py:19361 ms4.7%
CursorWrapper.executedjango/db/backends/utils.py:791 ms4.7%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:921 ms4.7%
QueryTracker._django_wrapperflakytest/profiling/dbtrack.py:1001 ms4.7%
CursorWrapper._executedjango/db/backends/utils.py:1051 ms4.7%
Cursor.executepsycopg/cursor.py:1131 ms4.7%
Connection.waitpsycopg/connection.py:4951 ms4.7%
BaseCursor._execute_genpsycopg/_cursor_base.py:2061 ms4.7%
BaseCursor._maybe_prepare_genpsycopg/_cursor_base.py:2861 ms4.7%
ClientCursorMixin._execute_sendpsycopg/client_cursor.py:781 ms4.7%
TestSyncAnnouncements.test_leaves_already_posted_announcements_untouchedconfs/tests.py:1028 conference.refresh_from_db()1 ms4.7%
Model.refresh_from_dbdjango/db/models/base.py:7881 ms4.7%
QuerySet.getdjango/db/models/query.py:7021 ms4.7%
QuerySet.__len__django/db/models/query.py:4211 ms4.7%
QuerySet._fetch_alldjango/db/models/query.py:22621 ms4.7%
ModelIterable.__iter__django/db/models/query.py:1031 ms4.7%
SQLCompiler.execute_sqldjango/db/models/sql/compiler.py:16231 ms4.7%
async_unsafe.<locals>.decorator.<locals>.innerdjango/utils/asyncio.py:261 ms4.7%
TestSyncAnnouncements.test_leaves_already_posted_announcements_untouchedconfs/tests.py:1029 start = conference.start_announcement1 ms4.7%
ForwardManyToOneDescriptor.__get__django/db/models/fields/related_descriptors.py:2661 ms4.7%
FetchOne.fetchdjango/db/models/fetch_modes.py:171 ms4.7%
ForwardManyToOneDescriptor.fetch_onedjango/db/models/fields/related_descriptors.py:2791 ms4.7%
ForwardOneToOneDescriptor.get_objectdjango/db/models/fields/related_descriptors.py:4091 ms4.7%
ForwardManyToOneDescriptor.get_objectdjango/db/models/fields/related_descriptors.py:2311 ms4.7%
QuerySet.getdjango/db/models/query.py:7021 ms4.7%
QuerySet.__len__django/db/models/query.py:4211 ms4.7%
QuerySet._fetch_alldjango/db/models/query.py:22621 ms4.7%
ModelIterable.__iter__django/db/models/query.py:1031 ms4.7%
SQLCompiler.execute_sqldjango/db/models/sql/compiler.py:16251 ms4.7%
CursorWrapper.executedjango/db/backends/utils.py:791 ms4.7%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:921 ms4.7%
QueryTracker._django_wrapperflakytest/profiling/dbtrack.py:1001 ms4.7%
CursorWrapper._executedjango/db/backends/utils.py:1051 ms4.7%
Cursor.executepsycopg/cursor.py:1131 ms4.7%
Connection.waitpsycopg/connection.py:4951 ms4.7%
TestSyncAnnouncements.test_leaves_already_posted_announcements_untouchedconfs/tests.py:1032 start.save()1 ms4.7%
Model.savedjango/db/models/base.py:9041 ms4.7%
Model.save_basedjango/db/models/base.py:9961 ms4.7%
Model._save_tabledjango/db/models/base.py:11401 ms4.7%
Model._do_updatedjango/db/models/base.py:12441 ms4.7%
QuerySet._updatedjango/db/models/query.py:14481 ms4.7%
SQLUpdateCompiler.execute_returning_sqldjango/db/models/sql/compiler.py:21501 ms4.7%
SQLUpdateCompiler.execute_sqldjango/db/models/sql/compiler.py:21211 ms4.7%
SQLCompiler.execute_sqldjango/db/models/sql/compiler.py:16121 ms4.7%
SQLUpdateCompiler.as_sqldjango/db/models/sql/compiler.py:20981 ms4.7%
SQLCompiler.compiledjango/db/models/sql/compiler.py:5751 ms4.7%
TestSyncAnnouncements.test_leaves_already_posted_announcements_untouchedconfs/tests.py:1035 conference.save()1 ms4.7%
Model.savedjango/db/models/base.py:9041 ms4.7%
Model.save_basedjango/db/models/base.py:9961 ms4.7%
Model._save_tabledjango/db/models/base.py:11401 ms4.7%
Model._do_updatedjango/db/models/base.py:12441 ms4.7%
QuerySet._updatedjango/db/models/query.py:14481 ms4.7%
SQLUpdateCompiler.execute_returning_sqldjango/db/models/sql/compiler.py:21501 ms4.7%
SQLUpdateCompiler.execute_sqldjango/db/models/sql/compiler.py:21211 ms4.7%
SQLCompiler.execute_sqldjango/db/models/sql/compiler.py:16251 ms4.7%
CursorWrapper.executedjango/db/backends/utils.py:791 ms4.7%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:921 ms4.7%
QueryTracker._django_wrapperflakytest/profiling/dbtrack.py:1001 ms4.7%
CursorWrapper._executedjango/db/backends/utils.py:1051 ms4.7%
Cursor.executepsycopg/cursor.py:1131 ms4.7%
Connection.waitpsycopg/connection.py:4951 ms4.7%
BaseCursor._execute_genpsycopg/_cursor_base.py:2061 ms4.7%
BaseCursor._maybe_prepare_genpsycopg/_cursor_base.py:2861 ms4.7%
ClientCursorMixin._execute_sendpsycopg/client_cursor.py:781 ms4.7%
TestSyncAnnouncements.test_leaves_already_posted_announcements_untouchedconfs/tests.py:1038 start.refresh_from_db()1 ms4.7%
Model.refresh_from_dbdjango/db/models/base.py:7881 ms4.7%
QuerySet.getdjango/db/models/query.py:7021 ms4.7%
QuerySet.__len__django/db/models/query.py:4211 ms4.7%
QuerySet._fetch_alldjango/db/models/query.py:22621 ms4.7%
ModelIterable.__iter__django/db/models/query.py:1031 ms4.7%
SQLCompiler.execute_sqldjango/db/models/sql/compiler.py:16251 ms4.7%
CursorWrapper.executedjango/db/backends/utils.py:791 ms4.7%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:921 ms4.7%
QueryTracker._django_wrapperflakytest/profiling/dbtrack.py:1001 ms4.7%
CursorWrapper._executedjango/db/backends/utils.py:1051 ms4.7%
Cursor.executepsycopg/cursor.py:1131 ms4.7%
Connection.waitpsycopg/connection.py:4951 ms4.7%
SimpleTestCase._setup_and_calldjango/test/testcases.py:3721 ms4.7%
TransactionTestCase._post_teardowndjango/test/testcases.py:1243 self._fixture_teardown()1 ms4.7%
TestCase._fixture_teardowndjango/test/testcases.py:14981 ms4.7%
DatabaseWrapper.check_constraintsdjango/db/backends/postgresql/base.py:4951 ms4.7%
CursorWrapper.executedjango/db/backends/utils.py:791 ms4.7%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:921 ms4.7%
QueryTracker._django_wrapperflakytest/profiling/dbtrack.py:1001 ms4.7%
CursorWrapper._executedjango/db/backends/utils.py:1031 ms4.7%
Cursor.executepsycopg/cursor.py:1131 ms4.7%
Connection.waitpsycopg/connection.py:4951 ms4.7%
BaseCursor._execute_genpsycopg/_cursor_base.py:2061 ms4.7%
BaseCursor._maybe_prepare_genpsycopg/_cursor_base.py:2861 ms4.7%
ClientCursorMixin._execute_sendpsycopg/client_cursor.py:781 ms4.7%
_multicallpluggy/_callers.py:1521 ms4.7%
CaptureManager.pytest_runtest_call_pytest/capture.py:8991 ms4.7%
Estimated from 21 samples; phase durations are exact. Frames from pytest and pluggy are shown .

Hot lines in your code

confs/conference_announcements.py:107
for conference in upcoming:
sync_upcoming · Database
3 ms
confs/tests.py:933
return baker.make(Conference, **defaults)
TestSyncAnnouncements._conference · Factories
2 ms
confs/tests.py:936
with mock.patch("confs.management.commands.syncannouncements.timezone.now", return_value=self.NOW):
TestSyncAnnouncements._sync · Mocking
2 ms
confs/conference_announcements.py:85
announcement = announcement_model.objects.create(
sync_conference · Database
2 ms
confs/conference_announcements.py:104
upcoming = conference_model.objects.filter(
sync_upcoming · Database
1 ms
confs/conference_announcements.py:70
body = templates[index].format(name=conference.name) + f"\n{url}"
content_for · App code
1 ms
confs/management/commands/syncannouncements.py:14
self.console.print("Done syncing announcements 🎉")
Command.handle · Libraries
1 ms
confs/tests.py:1028
conference.refresh_from_db()
TestSyncAnnouncements.test_leaves_already_posted_announcements_untouched · Database
1 ms
confs/tests.py:1029
start = conference.start_announcement
TestSyncAnnouncements.test_leaves_already_posted_announcements_untouched · Database
1 ms
confs/tests.py:1032
start.save()
TestSyncAnnouncements.test_leaves_already_posted_announcements_untouched · Database
1 ms

Fixtures

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

Database

17 queries · 8 ms

Repeated queries are usually N+1 lookups: fetch them once with select_related / prefetch_related (or selectinload).

3×
SELECT "confs_conference"."id", "confs_conference"."name", "confs_conference"."slug", "confs_conference"."location", "confs_conference"."start_date", "confs_conference"."end_date", "confs_conference"."time_zone", "confs_conference"."archived_date", "confs_conference"."approved_at", "confs_conferenc…

Biggest pieces of work

call test body
confs/tests.py:1036
18 ms
setup pytest internals 1 ms
call _post_teardown
django/test/testcases.py:1243
1 ms
call pytest internals 1 ms

Reliability

5 results · 0 CI failures · 0 local failures

This test hasn't failed recently.

History

Latest 5 results, oldest first in the strip
When Environment Outcome Duration Commit
10 hours ago CI github-actions:test passed 22 ms d923a46 main Profile
10 hours ago CI github-actions:test passed 35 ms 82997f8 main Profile
10 hours ago CI github-actions:test passed 54 ms 623aa3e main Profile
15 hours ago CI github-actions:test passed 57 ms ab6465a main Profile
15 hours ago CI github-actions:test passed 21 ms 0c23747 main Run