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

RealProfileDocumentTest::test_processed

First seen 1 month, 1 week ago in 78a4357
CI github-actions:test 15 runs
Average
16 ms
median 17 ms
max 21 ms
Phases
Setup 0.59 ms Call 14 ms Teardown 1 ms
Categories
Database 10 ms Other (Deep copies, pytest, Unsampled) 6 ms

13 database queries per run

Needs 3 KB of memory (max 12 KB)

Duration per run

Where the time goes

Latest run in ci:github-actions:test, 2 weeks ago · open run
Show pytest frames
setup0.50 ms3.0%
call13 ms78.2%
TransactionTestCase._post_teardowndjango/test/testcases.py:1240 self._fixture_teardown()4 ms21.3%
TestCase._fixture_teardowndjango/test/testcases.py:14952 ms14.2%
DatabaseWrapper.check_constraintsdjango/db/backends/postgresql/base.py:4832 ms14.2%
CursorWrapper.executedjango/db/backends/utils.py:792 ms14.2%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:922 ms14.2%
CursorWrapper._executedjango/db/backends/utils.py:1032 ms14.2%
Cursor.executepsycopg/cursor.py:1132 ms14.2%
Connection.waitpsycopg/connection.py:4952 ms14.2%
BaseCursor._execute_genpsycopg/_cursor_base.py:2062 ms14.2%
BaseCursor._maybe_prepare_genpsycopg/_cursor_base.py:2862 ms14.2%
ClientCursorMixin._execute_sendpsycopg/client_cursor.py:782 ms14.2%
TestCase._fixture_teardowndjango/test/testcases.py:14971 ms7.1%
TestCase._rollback_atomicsdjango/test/testcases.py:14051 ms7.1%
Atomic.__exit__django/db/transaction.py:2831 ms7.1%
async_unsafe.<locals>.decorator.<locals>.innerdjango/utils/asyncio.py:261 ms7.1%
BaseDatabaseWrapper.savepoint_rollbackdjango/db/backends/base/base.py:4131 ms7.1%
BaseDatabaseWrapper._savepoint_rollbackdjango/db/backends/base/base.py:3711 ms7.1%
CursorWrapper.executedjango/db/backends/utils.py:791 ms7.1%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:921 ms7.1%
CursorWrapper._executedjango/db/backends/utils.py:1031 ms7.1%
Cursor.executepsycopg/cursor.py:1131 ms7.1%
Connection.waitpsycopg/connection.py:4951 ms7.1%
RealProfileDocumentTest.test_processedapps/projects/tests.py:853 self.assertEqual(perf.samples, sum(find_test_entry(self.local_document, self.nodeid)["samples"].values()))2 ms14.2%
TestData.__get__django/test/testcases.py:13672 ms14.2%
deepcopy<stdlib>/copy.py:1302 ms14.2%
_deepcopy_dict<stdlib>/copy.py:2012 ms14.2%
deepcopy<stdlib>/copy.py:1302 ms14.2%
_deepcopy_list<stdlib>/copy.py:1762 ms14.2%
RealProfileDocumentTest.test_processedapps/projects/tests.py:851 perf = TestPerf.objects.get(profile=self.local, test__name=self.nodeid)2 ms14.2%
BaseManager._get_queryset_methods.<locals>.create_method.<locals>.manager_methoddjango/db/models/manager.py:872 ms14.2%
QuerySet.getdjango/db/models/query.py:6352 ms14.2%
QuerySet.__len__django/db/models/query.py:3722 ms14.2%
QuerySet._fetch_alldjango/db/models/query.py:20002 ms14.2%
ModelIterable.__iter__django/db/models/query.py:952 ms14.2%
SQLCompiler.execute_sqldjango/db/models/sql/compiler.py:16241 ms7.1%
CursorWrapper.executedjango/db/backends/utils.py:791 ms7.1%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:921 ms7.1%
CursorWrapper._executedjango/db/backends/utils.py:1051 ms7.1%
Cursor.executepsycopg/cursor.py:1131 ms7.1%
Connection.waitpsycopg/connection.py:4951 ms7.1%
BaseCursor._execute_genpsycopg/_cursor_base.py:2061 ms7.1%
BaseCursor._maybe_prepare_genpsycopg/_cursor_base.py:2861 ms7.1%
ClientCursorMixin._execute_sendpsycopg/client_cursor.py:781 ms7.1%
SQLCompiler.execute_sqldjango/db/models/sql/compiler.py:16621 ms7.1%
cursor_iterdjango/db/models/sql/compiler.py:22541 ms7.1%
cursor_iter.<locals>.<lambda>django/db/models/sql/compiler.py:22541 ms7.1%
DatabaseErrorWrapper.__call__.<locals>.innerdjango/db/utils.py:1011 ms7.1%
Cursor.fetchmanypsycopg/cursor.py:2681 ms7.1%
RealProfileDocumentTest.test_processedapps/projects/tests.py:844 self.assertEqual(self.local.environment.name, "local:root@vm")1 ms7.1%
ForwardManyToOneDescriptor.__get__django/db/models/fields/related_descriptors.py:2571 ms7.1%
ForwardManyToOneDescriptor.get_objectdjango/db/models/fields/related_descriptors.py:2221 ms7.1%
QuerySet.getdjango/db/models/query.py:6351 ms7.1%
QuerySet.__len__django/db/models/query.py:3721 ms7.1%
QuerySet._fetch_alldjango/db/models/query.py:20001 ms7.1%
ModelIterable.__iter__django/db/models/query.py:951 ms7.1%
SQLCompiler.execute_sqldjango/db/models/sql/compiler.py:16111 ms7.1%
SQLCompiler.as_sqldjango/db/models/sql/compiler.py:7671 ms7.1%
SQLCompiler.pre_sql_setupdjango/db/models/sql/compiler.py:861 ms7.1%
SQLCompiler.setup_querydjango/db/models/sql/compiler.py:751 ms7.1%
SQLCompiler.get_selectdjango/db/models/sql/compiler.py:2551 ms7.1%
SQLCompiler.get_default_columnsdjango/db/models/sql/compiler.py:10091 ms7.1%
RealProfileDocumentTest.test_processedapps/projects/tests.py:846 self.assertEqual(self.ci.environment.name, "ci:github-actions:test")1 ms7.1%
ForwardManyToOneDescriptor.__get__django/db/models/fields/related_descriptors.py:2571 ms7.1%
ForwardManyToOneDescriptor.get_objectdjango/db/models/fields/related_descriptors.py:2221 ms7.1%
QuerySet.getdjango/db/models/query.py:6351 ms7.1%
QuerySet.__len__django/db/models/query.py:3721 ms7.1%
QuerySet._fetch_alldjango/db/models/query.py:20001 ms7.1%
ModelIterable.__iter__django/db/models/query.py:951 ms7.1%
SQLCompiler.execute_sqldjango/db/models/sql/compiler.py:16111 ms7.1%
SQLCompiler.as_sqldjango/db/models/sql/compiler.py:7671 ms7.1%
SQLCompiler.pre_sql_setupdjango/db/models/sql/compiler.py:861 ms7.1%
SQLCompiler.setup_querydjango/db/models/sql/compiler.py:751 ms7.1%
SQLCompiler.get_selectdjango/db/models/sql/compiler.py:3171 ms7.1%
SQLCompiler.compiledjango/db/models/sql/compiler.py:5781 ms7.1%
Col.as_sqldjango/db/models/expressions.py:13251 ms7.1%
RealProfileDocumentTest.test_processedapps/projects/tests.py:849 self.assertEqual(TestPerf.objects.filter(profile=self.local).count(), 15)1 ms7.1%
QuerySet.countdjango/db/models/query.py:6101 ms7.1%
Query.get_countdjango/db/models/sql/query.py:6511 ms7.1%
Query.get_aggregationdjango/db/models/sql/query.py:6331 ms7.1%
SQLCompiler.execute_sqldjango/db/models/sql/compiler.py:16241 ms7.1%
CursorWrapper.executedjango/db/backends/utils.py:791 ms7.1%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:921 ms7.1%
CursorWrapper._executedjango/db/backends/utils.py:1051 ms7.1%
Cursor.executepsycopg/cursor.py:1131 ms7.1%
Connection.waitpsycopg/connection.py:4951 ms7.1%
BaseCursor._execute_genpsycopg/_cursor_base.py:2061 ms7.1%
BaseCursor._maybe_prepare_genpsycopg/_cursor_base.py:2861 ms7.1%
ClientCursorMixin._execute_sendpsycopg/client_cursor.py:781 ms7.1%
RealProfileDocumentTest.test_processedapps/projects/tests.py:856 snapshot = TestSnapshot.objects.get(test=perf.test, environment=perf.environment)1 ms7.1%
BaseManager._get_queryset_methods.<locals>.create_method.<locals>.manager_methoddjango/db/models/manager.py:871 ms7.1%
QuerySet.getdjango/db/models/query.py:6351 ms7.1%
QuerySet.__len__django/db/models/query.py:3721 ms7.1%
QuerySet._fetch_alldjango/db/models/query.py:20001 ms7.1%
ModelIterable.__iter__django/db/models/query.py:951 ms7.1%
SQLCompiler.execute_sqldjango/db/models/sql/compiler.py:16241 ms7.1%
CursorWrapper.executedjango/db/backends/utils.py:791 ms7.1%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:921 ms7.1%
CursorWrapper._executedjango/db/backends/utils.py:1051 ms7.1%
Cursor.executepsycopg/cursor.py:1131 ms7.1%
Connection.waitpsycopg/connection.py:4951 ms7.1%
BaseCursor._execute_genpsycopg/_cursor_base.py:2061 ms7.1%
BaseCursor._maybe_prepare_genpsycopg/_cursor_base.py:2861 ms7.1%
ClientCursorMixin._execute_sendpsycopg/client_cursor.py:781 ms7.1%
teardown3 ms18.8%
TestCase.tearDownClassdjango/test/testcases.py:1455 conn.close()3 ms18.8%
async_unsafe.<locals>.decorator.<locals>.innerdjango/utils/asyncio.py:263 ms18.8%
BaseDatabaseWrapper.closedjango/db/backends/base/base.py:3553 ms18.8%
DatabaseWrapper._closedjango/db/backends/postgresql/base.py:3963 ms18.8%
Connection.closepsycopg/connection.py:2013 ms18.8%
Estimated from 15 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
2 ms
apps/projects/tests.py:851
perf = TestPerf.objects.get(profile=self.local, test__name=self.nodeid)
RealProfileDocumentTest.test_processed · Database
2 ms
apps/projects/tests.py:844
self.assertEqual(self.local.environment.name, "local:root@vm")
RealProfileDocumentTest.test_processed · Database
1 ms
apps/projects/tests.py:846
self.assertEqual(self.ci.environment.name, "ci:github-actions:test")
RealProfileDocumentTest.test_processed · Database
1 ms
apps/projects/tests.py:849
self.assertEqual(TestPerf.objects.filter(profile=self.local).count(), 15)
RealProfileDocumentTest.test_processed · Database
1 ms
apps/projects/tests.py:856
snapshot = TestSnapshot.objects.get(test=perf.test, environment=perf.environment)
RealProfileDocumentTest.test_processed · Database
1 ms

Fixtures

Exact setup time
_dj_autoclear_mailbox function 0.04 ms
_template_string_if_invalid_marker function 0.04 ms
_django_db_marker 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.02 ms

Database

13 queries · 5 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:853
10 ms
call _post_teardown
django/test/testcases.py:1240
4 ms
teardown tearDownClass
django/test/testcases.py:1455
3 ms
setup pytest internals 0.50 ms

Reliability

15 results · 0 CI failures · 0 local failures

This test hasn't failed recently.

History

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