flakytest.dev anze3db flakytest
Tests / apps/projects/tests.py

RealProfileDocumentTest::test_processed

First seen 3 weeks ago in 78a4357
CI github-actions:test 12 runs
Average
15 ms
median 16 ms
max 19 ms
Phases
Setup 0.62 ms Call 14 ms Teardown 1 ms
Categories
Database 9 ms Other (Deep copies, Unsampled, pytest) 6 ms

13 database queries per run

Needs 1 KB of memory (max 4 KB)

Duration per run

Where the time goes

Latest run in ci:github-actions:test, 16 hours ago · open run
Show pytest frames
call14 ms89.1%
TransactionTestCase._post_teardowndjango/test/testcases.py:1240 self._fixture_teardown()5 ms32.4%
TestCase._fixture_teardowndjango/test/testcases.py:14953 ms16.2%
DatabaseWrapper.check_constraintsdjango/db/backends/postgresql/base.py:4833 ms16.2%
CursorWrapper.executedjango/db/backends/utils.py:793 ms16.2%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:923 ms16.2%
CursorWrapper._executedjango/db/backends/utils.py:1033 ms16.2%
Cursor.executepsycopg/cursor.py:1133 ms16.2%
Connection.waitpsycopg/connection.py:4953 ms16.2%
TestCase._fixture_teardowndjango/test/testcases.py:14941 ms8.1%
TestCase._should_check_constraintsdjango/test/testcases.py:15031 ms8.1%
DatabaseWrapper.is_usabledjango/db/backends/postgresql/base.py:4921 ms8.1%
Cursor.executepsycopg/cursor.py:1131 ms8.1%
Connection.waitpsycopg/connection.py:4951 ms8.1%
TestCase._fixture_teardowndjango/test/testcases.py:14971 ms8.1%
TestCase._rollback_atomicsdjango/test/testcases.py:14051 ms8.1%
Atomic.__exit__django/db/transaction.py:2861 ms8.1%
async_unsafe.<locals>.decorator.<locals>.innerdjango/utils/asyncio.py:261 ms8.1%
BaseDatabaseWrapper.savepoint_commitdjango/db/backends/base/base.py:4311 ms8.1%
BaseDatabaseWrapper._savepoint_commitdjango/db/backends/base/base.py:3751 ms8.1%
CursorWrapper.executedjango/db/backends/utils.py:791 ms8.1%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:921 ms8.1%
CursorWrapper._executedjango/db/backends/utils.py:1031 ms8.1%
Cursor.executepsycopg/cursor.py:1131 ms8.1%
Connection.waitpsycopg/connection.py:4951 ms8.1%
BaseCursor._execute_genpsycopg/_cursor_base.py:2061 ms8.1%
BaseCursor._maybe_prepare_genpsycopg/_cursor_base.py:2861 ms8.1%
ClientCursorMixin._execute_sendpsycopg/client_cursor.py:781 ms8.1%
RealProfileDocumentTest.test_processedapps/projects/tests.py:853 self.assertEqual(perf.samples, sum(find_test_entry(self.local_document, self.nodeid)["samples"].values()))3 ms16.2%
TestData.__get__django/test/testcases.py:13673 ms16.2%
deepcopy<stdlib>/copy.py:1303 ms16.2%
_deepcopy_dict<stdlib>/copy.py:2013 ms16.2%
deepcopy<stdlib>/copy.py:1303 ms16.2%
_deepcopy_list<stdlib>/copy.py:1763 ms16.2%
deepcopy<stdlib>/copy.py:1303 ms16.2%
_deepcopy_list<stdlib>/copy.py:1761 ms8.1%
_deepcopy_list<stdlib>/copy.py:1731 ms8.1%
<GC>~1 ms8.1%
RealProfileDocumentTest.test_processedapps/projects/tests.py:856 snapshot = TestSnapshot.objects.get(test=perf.test, environment=perf.environment)3 ms16.2%
ForwardManyToOneDescriptor.__get__django/db/models/fields/related_descriptors.py:2571 ms8.1%
ForwardManyToOneDescriptor.get_objectdjango/db/models/fields/related_descriptors.py:2221 ms8.1%
QuerySet.getdjango/db/models/query.py:6351 ms8.1%
QuerySet.__len__django/db/models/query.py:3721 ms8.1%
QuerySet._fetch_alldjango/db/models/query.py:20001 ms8.1%
ModelIterable.__iter__django/db/models/query.py:951 ms8.1%
SQLCompiler.execute_sqldjango/db/models/sql/compiler.py:16241 ms8.1%
CursorWrapper.executedjango/db/backends/utils.py:791 ms8.1%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:921 ms8.1%
CursorWrapper._executedjango/db/backends/utils.py:1051 ms8.1%
Cursor.executepsycopg/cursor.py:1131 ms8.1%
Connection.waitpsycopg/connection.py:4951 ms8.1%
BaseManager._get_queryset_methods.<locals>.create_method.<locals>.manager_methoddjango/db/models/manager.py:871 ms8.1%
QuerySet.getdjango/db/models/query.py:6251 ms8.1%
QuerySet.filterdjango/db/models/query.py:15421 ms8.1%
QuerySet._filter_or_excludedjango/db/models/query.py:15601 ms8.1%
QuerySet._filter_or_exclude_inplacedjango/db/models/query.py:15701 ms8.1%
Query.add_qdjango/db/models/sql/query.py:16711 ms8.1%
Query._add_qdjango/db/models/sql/query.py:17031 ms8.1%
Query.build_filterdjango/db/models/sql/query.py:15731 ms8.1%
Query.get_initial_aliasdjango/db/models/sql/query.py:11161 ms8.1%
RealProfileDocumentTest.test_processedapps/projects/tests.py:844 self.assertEqual(self.local.environment.name, "local:root@vm")1 ms8.1%
TestData.__get__django/test/testcases.py:13671 ms8.1%
deepcopy<stdlib>/copy.py:1561 ms8.1%
_reconstruct<stdlib>/copy.py:2541 ms8.1%
deepcopy<stdlib>/copy.py:1301 ms8.1%
_deepcopy_dict<stdlib>/copy.py:2011 ms8.1%
deepcopy<stdlib>/copy.py:1301 ms8.1%
_deepcopy_list<stdlib>/copy.py:1761 ms8.1%
deepcopy<stdlib>/copy.py:1611 ms8.1%
_keep_alive<stdlib>/copy.py:2371 ms8.1%
RealProfileDocumentTest.test_processedapps/projects/tests.py:850 self.assertEqual(TestPerf.objects.filter(profile=self.ci).count(), 15)1 ms8.1%
QuerySet.countdjango/db/models/query.py:6101 ms8.1%
Query.get_countdjango/db/models/sql/query.py:6511 ms8.1%
Query.get_aggregationdjango/db/models/sql/query.py:6331 ms8.1%
SQLCompiler.execute_sqldjango/db/models/sql/compiler.py:16241 ms8.1%
CursorWrapper.executedjango/db/backends/utils.py:791 ms8.1%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:921 ms8.1%
CursorWrapper._executedjango/db/backends/utils.py:1051 ms8.1%
Cursor.executepsycopg/cursor.py:1131 ms8.1%
Connection.waitpsycopg/connection.py:4951 ms8.1%
RealProfileDocumentTest.test_processedapps/projects/tests.py:851 perf = TestPerf.objects.get(profile=self.local, test__name=self.nodeid)1 ms8.1%
BaseManager._get_queryset_methods.<locals>.create_method.<locals>.manager_methoddjango/db/models/manager.py:871 ms8.1%
QuerySet.getdjango/db/models/query.py:6351 ms8.1%
QuerySet.__len__django/db/models/query.py:3721 ms8.1%
QuerySet._fetch_alldjango/db/models/query.py:20001 ms8.1%
ModelIterable.__iter__django/db/models/query.py:951 ms8.1%
SQLCompiler.execute_sqldjango/db/models/sql/compiler.py:16241 ms8.1%
CursorWrapper.executedjango/db/backends/utils.py:791 ms8.1%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:921 ms8.1%
CursorWrapper._executedjango/db/backends/utils.py:1051 ms8.1%
Cursor.executepsycopg/cursor.py:1131 ms8.1%
Connection.waitpsycopg/connection.py:4951 ms8.1%
teardown1 ms6.6%
TestCase.tearDownClassdjango/test/testcases.py:1455 conn.close()1 ms6.6%
async_unsafe.<locals>.decorator.<locals>.innerdjango/utils/asyncio.py:261 ms6.6%
BaseDatabaseWrapper.closedjango/db/backends/base/base.py:3551 ms6.6%
DatabaseWrapper._closedjango/db/backends/postgresql/base.py:3961 ms6.6%
Connection.closepsycopg/connection.py:2011 ms6.6%
Estimated from 12 samples; phase durations are exact. Frames from pytest and pluggy are hidden .

Hot lines in your code

apps/projects/tests.py:853
self.assertEqual(perf.samples, sum(find_test_entry(self.local_document, self.nodeid)["samples"].values()))
RealProfileDocumentTest.test_processed · Deep copies
3 ms
apps/projects/tests.py:856
snapshot = TestSnapshot.objects.get(test=perf.test, environment=perf.environment)
RealProfileDocumentTest.test_processed · Database
3 ms
apps/projects/tests.py:844
self.assertEqual(self.local.environment.name, "local:root@vm")
RealProfileDocumentTest.test_processed · Deep copies
1 ms
apps/projects/tests.py:850
self.assertEqual(TestPerf.objects.filter(profile=self.ci).count(), 15)
RealProfileDocumentTest.test_processed · Database
1 ms
apps/projects/tests.py:851
perf = TestPerf.objects.get(profile=self.local, test__name=self.nodeid)
RealProfileDocumentTest.test_processed · Database
1 ms

Fixtures

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

Database

13 queries · 6 ms

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

3×
SELECT "projects_environment"."id", "projects_environment"."project_id", "projects_environment"."name", "projects_environment"."kind", "projects_environment"."provider", "projects_environment"."details", "projects_environment"."date_first_seen", "projects_environment"."date_last_seen" FROM "project…

Biggest pieces of work

call test body
apps/projects/tests.py:844
9 ms
call _post_teardown
django/test/testcases.py:1240
5 ms
teardown tearDownClass
django/test/testcases.py:1455
1 ms

Reliability

12 results · 0 CI failures · 0 local failures

This test hasn't failed recently.

History

Latest 12 results, oldest first in the strip
When Environment Outcome Duration Commit
16 hours ago CI github-actions:test passed 15 ms e141198 main Profile
1 week, 5 days ago CI github-actions:test passed 9 ms 46ec2aa main Profile
2 weeks, 1 day ago CI github-actions:test passed 16 ms afde85b main Profile
2 weeks, 1 day ago CI github-actions:test passed 14 ms fe29f9d main Profile
2 weeks, 1 day ago CI github-actions:test passed 18 ms 044719a main Profile
2 weeks, 2 days ago CI github-actions:test passed 11 ms b3fedae main Profile
2 weeks, 4 days ago CI github-actions:test passed 19 ms 43c4eda main Profile
2 weeks, 6 days ago CI github-actions:test passed 17 ms 9caa567 main Profile
2 weeks, 6 days ago CI github-actions:test passed 16 ms ec75501 main Profile
3 weeks ago CI github-actions:test passed 19 ms d2c12e5 main Profile
3 weeks ago CI github-actions:test passed 12 ms 0b902f6 main Profile
3 weeks ago CI github-actions:test passed 19 ms 78a4357 main Profile