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

McpTest::test_compare_environments

First seen 3 weeks ago in 78a4357
CI github-actions:test 12 runs
Average
50 ms
median 52 ms
max 76 ms
Phases
Setup 0.66 ms Call 49 ms Teardown 0.16 ms
Categories
Database 20 ms App code 0.79 ms Other (Libraries, Unsampled, pytest) 29 ms

18 database queries per run

Needs 172 KB of memory (max 800 KB)

Duration per run

Where the time goes

Latest run in ci:github-actions:test, 16 hours ago · open run
Show pytest frames
setup0.67 ms1.3%
__init____init__:-10.67 ms1.3%
call50 ms98.4%
McpTest.test_compare_environmentsapps/mcp/tests.py:245 result = self.call("compare_environments", env_a="ci", env_b="local")46 ms89.8%
McpTest.callapps/mcp/tests.py:8246 ms89.8%
McpTest.rpcapps/mcp/tests.py:7546 ms89.8%
McpTest.postapps/mcp/tests.py:67 return self.client.post(46 ms89.8%
Client.postdjango/test/client.py:115346 ms89.8%
RequestFactory.postdjango/test/client.py:49946 ms89.8%
RequestFactory.genericdjango/test/client.py:67146 ms89.8%
Client.requestdjango/test/client.py:108246 ms89.8%
ClientHandler.__call__django/test/client.py:17330 ms59.9%
BaseHandler.load_middlewaredjango/core/handlers/base.py:6228 ms55.6%
WhiteNoiseMiddleware.__init__whitenoise/middleware.py:10428 ms55.6%
WhiteNoise.add_fileswhitenoise/base.py:10828 ms55.6%
WhiteNoise.update_files_dictionarywhitenoise/base.py:12026 ms51.3%
WhiteNoise.add_file_to_dictionarywhitenoise/base.py:13124 ms47.1%
WhiteNoise.get_static_filewhitenoise/base.py:20820 ms38.5%
StaticFile.__init__whitenoise/responders.py:779 ms17.1%
StaticFile.get_alternativeswhitenoise/responders.py:2007 ms12.8%
StaticFile.get_alternativeswhitenoise/responders.py:2012 ms4.3%
Headers.__setitem__<stdlib>/wsgiref/headers.py:622 ms4.3%
Headers.__delitem__<stdlib>/wsgiref/headers.py:722 ms4.3%
<GC>~2 ms4.3%
StaticFile.__init__whitenoise/responders.py:737 ms12.8%
StaticFile.get_headerswhitenoise/responders.py:1764 ms8.6%
formatdate<stdlib>/email/utils.py:2662 ms4.3%
StaticFile.get_headerswhitenoise/responders.py:1672 ms4.3%
StaticFile.__init__whitenoise/responders.py:742 ms4.3%
Headers.__getitem__<stdlib>/wsgiref/headers.py:832 ms4.3%
StaticFile.__init__whitenoise/responders.py:762 ms4.3%
StaticFile.get_not_modified_responsewhitenoise/responders.py:1882 ms4.3%
Headers.__contains__<stdlib>/wsgiref/headers.py:872 ms4.3%
Headers.get<stdlib>/wsgiref/headers.py:1082 ms4.3%
WhiteNoise.get_static_filewhitenoise/base.py:2034 ms8.6%
WhiteNoise.add_cache_headerswhitenoise/base.py:2244 ms8.6%
WhiteNoiseMiddleware.immutable_file_testwhitenoise/middleware.py:1764 ms8.6%
WhiteNoiseMiddleware.get_static_urlwhitenoise/middleware.py:1974 ms8.6%
URLMixin.urldebug_toolbar/panels/staticfiles.py:202 ms4.3%
HashedFilesMixin.urldjango/contrib/staticfiles/storage.py:2052 ms4.3%
HashedFilesMixin._urldjango/contrib/staticfiles/storage.py:1772 ms4.3%
<unknown function><unknown file>2 ms4.3%
WhiteNoise.update_files_dictionarywhitenoise/base.py:1152 ms4.3%
scantreewhitenoise/base.py:2622 ms4.3%
scantreewhitenoise/base.py:2622 ms4.3%
scantreewhitenoise/base.py:2622 ms4.3%
scantreewhitenoise/base.py:2622 ms4.3%
scantreewhitenoise/base.py:2622 ms4.3%
scantreewhitenoise/base.py:2642 ms4.3%
BaseHandler.load_middlewaredjango/core/handlers/base.py:962 ms4.3%
ClientHandler.__call__django/test/client.py:18615 ms29.9%
BaseHandler.get_responsedjango/core/handlers/base.py:14115 ms29.9%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5515 ms29.9%
DebugToolbarMiddleware.__call__debug_toolbar/middleware.py:13015 ms29.9%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5515 ms29.9%
MiddlewareMixin.__call__django/utils/deprecation.py:30915 ms29.9%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5515 ms29.9%
WhiteNoiseMiddleware.__call__whitenoise/middleware.py:12315 ms29.9%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5515 ms29.9%
MiddlewareMixin.__call__django/utils/deprecation.py:30915 ms29.9%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5515 ms29.9%
MiddlewareMixin.__call__django/utils/deprecation.py:30915 ms29.9%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5515 ms29.9%
MiddlewareMixin.__call__django/utils/deprecation.py:30915 ms29.9%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5515 ms29.9%
MiddlewareMixin.__call__django/utils/deprecation.py:30915 ms29.9%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5515 ms29.9%
MiddlewareMixin.__call__django/utils/deprecation.py:30915 ms29.9%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5515 ms29.9%
MiddlewareMixin.__call__django/utils/deprecation.py:30915 ms29.9%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5515 ms29.9%
AccountMiddleware.<locals>.middlewareallauth/account/middleware.py:3415 ms29.9%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5515 ms29.9%
BaseHandler._get_responsedjango/core/handlers/base.py:19813 ms25.7%
csrf_exempt.<locals>._view_wrapperdjango/views/decorators/csrf.py:6513 ms25.7%
mcpapps/mcp/urls.py:14713 ms25.7%
handleapps/mcp/urls.py:11513 ms25.7%
call_toolapps/mcp/urls.py:7513 ms25.7%
Tools.callapps/mcp/tools.py:18813 ms25.7%
Tools.compare_environmentsapps/mcp/tools.py:3879 ms17.1%
compareapps/projects/analytics.py:7114 ms8.6%
compare.<locals>.side_summaryapps/projects/analytics.py:696 Profile.objects.filter(2 ms4.3%
BaseManager._get_queryset_methods.<locals>.create_method.<locals>.manager_methoddjango/db/models/manager.py:872 ms4.3%
compare.<locals>.side_summaryapps/projects/analytics.py:705 "wall_time": statistics.fmean(d for _, d, _, _ in summaries) if summaries else None,2 ms4.3%
fmean<stdlib>/statistics.py:2072 ms4.3%
compareapps/projects/analytics.py:6542 ms4.3%
averages_by_testapps/projects/analytics.py:631 for row in daily_totals(rows)2 ms4.3%
QuerySet.__iter__django/db/models/query.py:3902 ms4.3%
QuerySet._fetch_alldjango/db/models/query.py:20002 ms4.3%
ValuesIterable.__iter__django/db/models/query.py:2222 ms4.3%
SQLCompiler.results_iterdjango/db/models/sql/compiler.py:15732 ms4.3%
SQLCompiler.execute_sqldjango/db/models/sql/compiler.py:16242 ms4.3%
CursorWrapper.executedjango/db/backends/utils.py:792 ms4.3%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:922 ms4.3%
CursorWrapper._executedjango/db/backends/utils.py:1052 ms4.3%
Cursor.executepsycopg/cursor.py:1132 ms4.3%
Connection.waitpsycopg/connection.py:4952 ms4.3%
compareapps/projects/analytics.py:6552 ms4.3%
averages_by_testapps/projects/analytics.py:631 for row in daily_totals(rows)2 ms4.3%
QuerySet.__iter__django/db/models/query.py:3902 ms4.3%
QuerySet._fetch_alldjango/db/models/query.py:20002 ms4.3%
ValuesIterable.__iter__django/db/models/query.py:2222 ms4.3%
SQLCompiler.results_iterdjango/db/models/sql/compiler.py:15732 ms4.3%
SQLCompiler.execute_sqldjango/db/models/sql/compiler.py:16242 ms4.3%
CursorWrapper.executedjango/db/backends/utils.py:792 ms4.3%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:922 ms4.3%
CursorWrapper._executedjango/db/backends/utils.py:1052 ms4.3%
Cursor.executepsycopg/cursor.py:1132 ms4.3%
Connection.waitpsycopg/connection.py:4952 ms4.3%
Tools.compare_environmentsapps/mcp/tools.py:3832 ms4.3%
Tools.scopeapps/mcp/tools.py:1802 ms4.3%
resolve_scopeapps/projects/analytics.py:206 environments=list(Environment.objects.filter(project=project, kind=env)),2 ms4.3%
QuerySet.__iter__django/db/models/query.py:3902 ms4.3%
QuerySet._fetch_alldjango/db/models/query.py:20002 ms4.3%
ModelIterable.__iter__django/db/models/query.py:952 ms4.3%
SQLCompiler.execute_sqldjango/db/models/sql/compiler.py:16222 ms4.3%
Tools.compare_environmentsapps/mcp/tools.py:3842 ms4.3%
Tools.scopeapps/mcp/tools.py:1802 ms4.3%
resolve_scopeapps/projects/analytics.py:206 environments=list(Environment.objects.filter(project=project, kind=env)),2 ms4.3%
QuerySet.__iter__django/db/models/query.py:3902 ms4.3%
QuerySet._fetch_alldjango/db/models/query.py:20002 ms4.3%
ModelIterable.__iter__django/db/models/query.py:952 ms4.3%
SQLCompiler.execute_sqldjango/db/models/sql/compiler.py:16242 ms4.3%
CursorWrapper.executedjango/db/backends/utils.py:792 ms4.3%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:922 ms4.3%
CursorWrapper._executedjango/db/backends/utils.py:1052 ms4.3%
Cursor.executepsycopg/cursor.py:1132 ms4.3%
Connection.waitpsycopg/connection.py:4952 ms4.3%
BaseHandler._get_responsedjango/core/handlers/base.py:2052 ms4.3%
BaseHandler.check_responsedjango/core/handlers/base.py:3222 ms4.3%
TransactionTestCase._post_teardowndjango/test/testcases.py:1240 self._fixture_teardown()4 ms8.6%
TestCase._fixture_teardowndjango/test/testcases.py:14952 ms4.3%
DatabaseWrapper.check_constraintsdjango/db/backends/postgresql/base.py:4832 ms4.3%
CursorWrapper.executedjango/db/backends/utils.py:792 ms4.3%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:922 ms4.3%
CursorWrapper._executedjango/db/backends/utils.py:1032 ms4.3%
Cursor.executepsycopg/cursor.py:1132 ms4.3%
Connection.waitpsycopg/connection.py:4952 ms4.3%
TestCase._fixture_teardowndjango/test/testcases.py:14972 ms4.3%
TestCase._rollback_atomicsdjango/test/testcases.py:14052 ms4.3%
Atomic.__exit__django/db/transaction.py:2862 ms4.3%
async_unsafe.<locals>.decorator.<locals>.innerdjango/utils/asyncio.py:262 ms4.3%
BaseDatabaseWrapper.savepoint_commitdjango/db/backends/base/base.py:4312 ms4.3%
BaseDatabaseWrapper._savepoint_commitdjango/db/backends/base/base.py:3752 ms4.3%
CursorWrapper.executedjango/db/backends/utils.py:792 ms4.3%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:922 ms4.3%
CursorWrapper._executedjango/db/backends/utils.py:1032 ms4.3%
Cursor.executepsycopg/cursor.py:1132 ms4.3%
Connection.waitpsycopg/connection.py:4952 ms4.3%
BaseCursor._execute_genpsycopg/_cursor_base.py:2062 ms4.3%
BaseCursor._maybe_prepare_genpsycopg/_cursor_base.py:2862 ms4.3%
ClientCursorMixin._execute_sendpsycopg/client_cursor.py:782 ms4.3%
Estimated from 24 samples; phase durations are exact. Frames from pytest and pluggy are hidden .

Hot lines in your code

apps/mcp/tests.py:67
return self.client.post(
McpTest.post · Libraries
33 ms
apps/projects/analytics.py:206
environments=list(Environment.objects.filter(project=project, kind=env)),
resolve_scope · Database
4 ms
apps/projects/analytics.py:631
for row in daily_totals(rows)
averages_by_test · Database
4 ms
apps/projects/analytics.py:696
Profile.objects.filter(
compare.<locals>.side_summary · Database
2 ms
apps/projects/analytics.py:705
"wall_time": statistics.fmean(d for _, d, _, _ in summaries) if summaries else None,
compare.<locals>.side_summary · Libraries
2 ms

Fixtures

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

Database

18 queries · 7 ms

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

4×
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/mcp/tests.py:245
46 ms
call _post_teardown
django/test/testcases.py:1240
4 ms
setup __init__
__init__:-1
0.67 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 51 ms e141198 main Profile
1 week, 5 days ago CI github-actions:test passed 34 ms 46ec2aa main Profile
2 weeks, 1 day ago CI github-actions:test passed 52 ms afde85b main Profile
2 weeks, 1 day ago CI github-actions:test passed 48 ms fe29f9d main Profile
2 weeks, 1 day ago CI github-actions:test passed 76 ms 044719a main Profile
2 weeks, 2 days ago CI github-actions:test passed 39 ms b3fedae main Profile
2 weeks, 4 days ago CI github-actions:test passed 54 ms 43c4eda main Profile
2 weeks, 6 days ago CI github-actions:test passed 54 ms 9caa567 main Profile
2 weeks, 6 days ago CI github-actions:test passed 52 ms ec75501 main Profile
3 weeks ago CI github-actions:test passed 56 ms d2c12e5 main Profile
3 weeks ago CI github-actions:test passed 27 ms 0b902f6 main Profile
3 weeks ago CI github-actions:test passed 52 ms 78a4357 main Profile