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

AnalyticsTest::test_environment_rows

First seen 9 hours ago in 78a4357
CI github-actions:test 5 runs
Average
7 ms
median 8 ms
max 9 ms
Phases
Setup 0.68 ms Call 7 ms Teardown 0.15 ms
Categories
Database 6 ms App code 0.76 ms Other (Unsampled, pytest) 0.84 ms

8 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, 2 hours ago · open run
Hide pytest frames
call7 ms88.0%
CallInfo.from_call_pytest/runner.py:3537 ms88.0%
call_and_report.<locals>.<lambda>_pytest/runner.py:2457 ms88.0%
HookCaller.__call__pluggy/_hooks.py:5127 ms88.0%
PluginManager._hookexecpluggy/_manager.py:1207 ms88.0%
_multicallpluggy/_callers.py:1217 ms88.0%
pytest_runtest_call_pytest/runner.py:1797 ms88.0%
_django_setup_unittest.<locals>.non_debugging_runtestpytest_django/plugin.py:5737 ms88.0%
SimpleTestCase.__call__django/test/testcases.py:3137 ms88.0%
SimpleTestCase._setup_and_calldjango/test/testcases.py:3684 ms52.8%
TestCase.__call__<stdlib>/unittest/case.py:7474 ms52.8%
TestCase.run<stdlib>/unittest/case.py:6914 ms52.8%
TestCase._callTestMethod<stdlib>/unittest/case.py:6374 ms52.8%
AnalyticsTest.test_environment_rowsapps/projects/tests.py:806 rows = environment_rows(self.project)4 ms52.8%
environment_rowsapps/projects/analytics.py:223 .annotate(1 ms17.6%
QuerySet.annotatedjango/db/models/query.py:16991 ms17.6%
QuerySet._annotatedjango/db/models/query.py:17511 ms17.6%
Query.add_annotationdjango/db/models/sql/query.py:12421 ms17.6%
Aggregate.resolve_expressiondjango/db/models/aggregates.py:1221 ms17.6%
environment_rowsapps/projects/analytics.py:234 for row in project.session_set.filter(date_created__gte=since).values("environment").annotate(count=Count("id"))1 ms17.6%
QuerySet.__iter__django/db/models/query.py:3901 ms17.6%
QuerySet._fetch_alldjango/db/models/query.py:20001 ms17.6%
ValuesIterable.__iter__django/db/models/query.py:2221 ms17.6%
SQLCompiler.results_iterdjango/db/models/sql/compiler.py:15731 ms17.6%
SQLCompiler.execute_sqldjango/db/models/sql/compiler.py:16241 ms17.6%
CursorWrapper.executedjango/db/backends/utils.py:791 ms17.6%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:921 ms17.6%
QueryTracker._django_wrapperflakytest/profiling/dbtrack.py:1001 ms17.6%
CursorWrapper._executedjango/db/backends/utils.py:1051 ms17.6%
Cursor.executepsycopg/cursor.py:1131 ms17.6%
Connection.waitpsycopg/connection.py:4951 ms17.6%
environment_rowsapps/projects/analytics.py:237 for environment in Environment.objects.filter(project=project):1 ms17.6%
QuerySet.__iter__django/db/models/query.py:3901 ms17.6%
QuerySet._fetch_alldjango/db/models/query.py:20001 ms17.6%
ModelIterable.__iter__django/db/models/query.py:951 ms17.6%
SQLCompiler.execute_sqldjango/db/models/sql/compiler.py:16241 ms17.6%
CursorWrapper.executedjango/db/backends/utils.py:791 ms17.6%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:921 ms17.6%
QueryTracker._django_wrapperflakytest/profiling/dbtrack.py:1001 ms17.6%
CursorWrapper._executedjango/db/backends/utils.py:1051 ms17.6%
Cursor.executepsycopg/cursor.py:1131 ms17.6%
Connection.waitpsycopg/connection.py:4951 ms17.6%
SimpleTestCase._setup_and_calldjango/test/testcases.py:3713 ms35.2%
TransactionTestCase._post_teardowndjango/test/testcases.py:1240 self._fixture_teardown()3 ms35.2%
TestCase._fixture_teardowndjango/test/testcases.py:14953 ms35.2%
DatabaseWrapper.check_constraintsdjango/db/backends/postgresql/base.py:4831 ms17.6%
CursorWrapper.executedjango/db/backends/utils.py:791 ms17.6%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:921 ms17.6%
QueryTracker._django_wrapperflakytest/profiling/dbtrack.py:1001 ms17.6%
CursorWrapper._executedjango/db/backends/utils.py:1031 ms17.6%
Cursor.executepsycopg/cursor.py:1131 ms17.6%
Connection.waitpsycopg/connection.py:4951 ms17.6%
DatabaseWrapper.check_constraintsdjango/db/backends/postgresql/base.py:4841 ms17.6%
CursorWrapper.executedjango/db/backends/utils.py:791 ms17.6%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:921 ms17.6%
QueryTracker._django_wrapperflakytest/profiling/dbtrack.py:1001 ms17.6%
CursorWrapper._executedjango/db/backends/utils.py:1031 ms17.6%
Cursor.executepsycopg/cursor.py:1131 ms17.6%
Connection.waitpsycopg/connection.py:4951 ms17.6%
teardown0.20 ms2.6%
CallInfo.from_call_pytest/runner.py:3530.20 ms2.6%
call_and_report.<locals>.<lambda>_pytest/runner.py:2450.20 ms2.6%
HookCaller.__call__pluggy/_hooks.py:5120.20 ms2.6%
PluginManager._hookexecpluggy/_manager.py:1200.20 ms2.6%
_multicallpluggy/_callers.py:1210.20 ms2.6%
pytest_runtest_teardown_pytest/runner.py:1940.20 ms2.6%
SetupState.teardown_exact_pytest/runner.py:5550.20 ms2.6%
FixtureDef.finish_pytest/fixtures.py:10420.20 ms2.6%
Estimated from 6 samples; phase durations are exact. Frames from pytest and pluggy are shown .

Hot lines in your code

apps/projects/analytics.py:223
.annotate(
environment_rows · Database
1 ms
apps/projects/analytics.py:234
for row in project.session_set.filter(date_created__gte=since).values("environment").annotate(count=Count("id"))
environment_rows · Database
1 ms
apps/projects/analytics.py:237
for environment in Environment.objects.filter(project=project):
environment_rows · 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.04 ms
_django_set_urlconf function 0.03 ms
_django_clear_site_cache function 0.03 ms
_live_server_helper function 0.03 ms
monkeypatch function 0.02 ms

Database

8 queries · 4 ms
No repeated queries.

Biggest pieces of work

call test body
apps/projects/tests.py:806
4 ms
call _post_teardown
django/test/testcases.py:1240
3 ms
teardown pytest internals 0.20 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
2 hours ago CI github-actions:test passed 8 ms 9caa567 main Profile
2 hours ago CI github-actions:test passed 7 ms ec75501 main Profile
9 hours ago CI github-actions:test passed 9 ms d2c12e5 main Profile
9 hours ago CI github-actions:test passed 6 ms 0b902f6 main Profile
9 hours ago CI github-actions:test passed 8 ms 78a4357 main Profile