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

McpTest::test_compare_environments

First seen 8 hours ago in 78a4357
CI github-actions:test 5 runs
Average
48 ms
median 52 ms
max 56 ms
Phases
Setup 0.74 ms Call 48 ms Teardown 0.17 ms
Categories
Database 23 ms Other (Libraries, Unsampled, pytest) 26 ms

18 database queries per run

Needs 0 KB of memory (max 0 KB)

Duration per run

Where the time goes

Latest run in ci:github-actions:test, 46 minutes ago · open run
Show pytest frames
call53 ms97.9%
McpTest.test_compare_environmentsapps/mcp/tests.py:244 result = self.call("compare_environments", env_a="ci", env_b="local")49 ms90.1%
McpTest.callapps/mcp/tests.py:8149 ms90.1%
McpTest.rpcapps/mcp/tests.py:7449 ms90.1%
McpTest.postapps/mcp/tests.py:66 return self.client.post(49 ms90.1%
Client.postdjango/test/client.py:115349 ms90.1%
RequestFactory.postdjango/test/client.py:49949 ms90.1%
RequestFactory.genericdjango/test/client.py:67149 ms90.1%
Client.requestdjango/test/client.py:108249 ms90.1%
ClientHandler.__call__django/test/client.py:17326 ms47.0%
BaseHandler.load_middlewaredjango/core/handlers/base.py:6226 ms47.0%
WhiteNoiseMiddleware.__init__whitenoise/middleware.py:10426 ms47.0%
WhiteNoise.add_fileswhitenoise/base.py:10826 ms47.0%
WhiteNoise.update_files_dictionarywhitenoise/base.py:12023 ms43.1%
WhiteNoise.add_file_to_dictionarywhitenoise/base.py:13123 ms43.1%
WhiteNoise.get_static_filewhitenoise/base.py:20821 ms39.2%
StaticFile.__init__whitenoise/responders.py:779 ms15.7%
StaticFile.get_alternativeswhitenoise/responders.py:2019 ms15.7%
StaticFile.__init__whitenoise/responders.py:764 ms7.8%
StaticFile.get_not_modified_responsewhitenoise/responders.py:1882 ms3.9%
StaticFile.get_not_modified_responsewhitenoise/responders.py:1892 ms3.9%
Headers.__getitem__<stdlib>/wsgiref/headers.py:832 ms3.9%
Headers.get<stdlib>/wsgiref/headers.py:1042 ms3.9%
Headers._convert_string_type<stdlib>/wsgiref/headers.py:502 ms3.9%
StaticFile.__init__whitenoise/responders.py:742 ms3.9%
parsedate<stdlib>/email/_parseaddr.py:1852 ms3.9%
StaticFile.__init__whitenoise/responders.py:722 ms3.9%
StaticFile.__init__whitenoise/responders.py:732 ms3.9%
WhiteNoise.get_static_filewhitenoise/base.py:2022 ms3.9%
WhiteNoise.update_files_dictionarywhitenoise/base.py:1152 ms3.9%
scantreewhitenoise/base.py:2622 ms3.9%
scantreewhitenoise/base.py:2622 ms3.9%
scantreewhitenoise/base.py:2602 ms3.9%
ClientHandler.__call__django/test/client.py:18623 ms43.1%
BaseHandler.get_responsedjango/core/handlers/base.py:14123 ms43.1%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5523 ms43.1%
DebugToolbarMiddleware.__call__debug_toolbar/middleware.py:13023 ms43.1%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5523 ms43.1%
MiddlewareMixin.__call__django/utils/deprecation.py:30923 ms43.1%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5523 ms43.1%
WhiteNoiseMiddleware.__call__whitenoise/middleware.py:12323 ms43.1%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5523 ms43.1%
MiddlewareMixin.__call__django/utils/deprecation.py:30923 ms43.1%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5523 ms43.1%
MiddlewareMixin.__call__django/utils/deprecation.py:30923 ms43.1%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5523 ms43.1%
MiddlewareMixin.__call__django/utils/deprecation.py:30923 ms43.1%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5523 ms43.1%
MiddlewareMixin.__call__django/utils/deprecation.py:30923 ms43.1%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5523 ms43.1%
MiddlewareMixin.__call__django/utils/deprecation.py:30923 ms43.1%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5523 ms43.1%
MiddlewareMixin.__call__django/utils/deprecation.py:30923 ms43.1%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5523 ms43.1%
AccountMiddleware.<locals>.middlewareallauth/account/middleware.py:3423 ms43.1%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5523 ms43.1%
BaseHandler._get_responsedjango/core/handlers/base.py:19823 ms43.1%
csrf_exempt.<locals>._view_wrapperdjango/views/decorators/csrf.py:6523 ms43.1%
mcpapps/mcp/urls.py:14719 ms35.2%
handleapps/mcp/urls.py:11519 ms35.2%
call_toolapps/mcp/urls.py:7519 ms35.2%
Tools.callapps/mcp/tools.py:18119 ms35.2%
Tools.compare_environmentsapps/mcp/tools.py:38015 ms27.4%
compareapps/projects/analytics.py:7116 ms11.7%
compare.<locals>.side_summaryapps/projects/analytics.py:695 summaries = list(4 ms7.8%
QuerySet.__iter__django/db/models/query.py:3904 ms7.8%
QuerySet._fetch_alldjango/db/models/query.py:20004 ms7.8%
ValuesListIterable.__iter__django/db/models/query.py:2384 ms7.8%
SQLCompiler.results_iterdjango/db/models/sql/compiler.py:15734 ms7.8%
SQLCompiler.execute_sqldjango/db/models/sql/compiler.py:16244 ms7.8%
CursorWrapper.executedjango/db/backends/utils.py:794 ms7.8%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:924 ms7.8%
CursorWrapper._executedjango/db/backends/utils.py:1054 ms7.8%
Cursor.executepsycopg/cursor.py:1134 ms7.8%
Connection.waitpsycopg/connection.py:4954 ms7.8%
compare.<locals>.side_summaryapps/projects/analytics.py:696 Profile.objects.filter(2 ms3.9%
BaseManager._get_queryset_methods.<locals>.create_method.<locals>.manager_methoddjango/db/models/manager.py:872 ms3.9%
compareapps/projects/analytics.py:6544 ms7.8%
averages_by_testapps/projects/analytics.py:631 for row in daily_totals(rows)4 ms7.8%
QuerySet.__iter__django/db/models/query.py:3904 ms7.8%
QuerySet._fetch_alldjango/db/models/query.py:20004 ms7.8%
ValuesIterable.__iter__django/db/models/query.py:2224 ms7.8%
SQLCompiler.results_iterdjango/db/models/sql/compiler.py:15734 ms7.8%
SQLCompiler.execute_sqldjango/db/models/sql/compiler.py:16112 ms3.9%
SQLCompiler.as_sqldjango/db/models/sql/compiler.py:7922 ms3.9%
SQLCompiler.get_from_clausedjango/db/models/sql/compiler.py:11592 ms3.9%
SQLCompiler.compiledjango/db/models/sql/compiler.py:5782 ms3.9%
Join.as_sqldjango/db/models/sql/datastructures.py:882 ms3.9%
SQLCompiler.execute_sqldjango/db/models/sql/compiler.py:16242 ms3.9%
CursorWrapper.executedjango/db/backends/utils.py:792 ms3.9%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:922 ms3.9%
CursorWrapper._executedjango/db/backends/utils.py:1052 ms3.9%
Cursor.executepsycopg/cursor.py:1132 ms3.9%
Connection.waitpsycopg/connection.py:4952 ms3.9%
compareapps/projects/analytics.py:6554 ms7.8%
averages_by_testapps/projects/analytics.py:631 for row in daily_totals(rows)4 ms7.8%
daily_totalsapps/projects/analytics.py:406 return rows.values("test_id", "test__name", "test__slug").annotate(2 ms3.9%
QuerySet.annotatedjango/db/models/query.py:16992 ms3.9%
QuerySet._annotatedjango/db/models/query.py:17512 ms3.9%
Query.add_annotationdjango/db/models/sql/query.py:12442 ms3.9%
Query.append_annotation_maskdjango/db/models/sql/query.py:25232 ms3.9%
BaseExpression.resolve_expressiondjango/db/models/expressions.py:3012 ms3.9%
QuerySet.__iter__django/db/models/query.py:3902 ms3.9%
QuerySet._fetch_alldjango/db/models/query.py:20002 ms3.9%
ValuesIterable.__iter__django/db/models/query.py:2222 ms3.9%
SQLCompiler.results_iterdjango/db/models/sql/compiler.py:15732 ms3.9%
SQLCompiler.execute_sqldjango/db/models/sql/compiler.py:16242 ms3.9%
CursorWrapper.executedjango/db/backends/utils.py:792 ms3.9%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:922 ms3.9%
CursorWrapper._executedjango/db/backends/utils.py:1052 ms3.9%
Cursor.executepsycopg/cursor.py:1132 ms3.9%
Connection.waitpsycopg/connection.py:4952 ms3.9%
Tools.compare_environmentsapps/mcp/tools.py:3772 ms3.9%
Tools.scopeapps/mcp/tools.py:1732 ms3.9%
resolve_scopeapps/projects/analytics.py:198 selected = Environment.objects.filter(project=project, name=env).first()2 ms3.9%
QuerySet.firstdjango/db/models/query.py:11452 ms3.9%
QuerySet.__iter__django/db/models/query.py:3902 ms3.9%
QuerySet._fetch_alldjango/db/models/query.py:20002 ms3.9%
ModelIterable.__iter__django/db/models/query.py:952 ms3.9%
SQLCompiler.execute_sqldjango/db/models/sql/compiler.py:16112 ms3.9%
SQLCompiler.as_sqldjango/db/models/sql/compiler.py:7672 ms3.9%
SQLCompiler.pre_sql_setupdjango/db/models/sql/compiler.py:872 ms3.9%
SQLCompiler.get_order_bydjango/db/models/sql/compiler.py:4912 ms3.9%
SQLCompiler._order_by_pairsdjango/db/models/sql/compiler.py:4742 ms3.9%
Tools.compare_environmentsapps/mcp/tools.py:3962 ms3.9%
Tools.urlapps/mcp/tools.py:1702 ms3.9%
Project.urlapps/projects/models.py:59 return reverse(name, args=[self.organization.slug, self.slug, *args])2 ms3.9%
ForwardManyToOneDescriptor.__get__django/db/models/fields/related_descriptors.py:2572 ms3.9%
ForwardManyToOneDescriptor.get_objectdjango/db/models/fields/related_descriptors.py:2222 ms3.9%
QuerySet.getdjango/db/models/query.py:6352 ms3.9%
QuerySet.__len__django/db/models/query.py:3722 ms3.9%
QuerySet._fetch_alldjango/db/models/query.py:20002 ms3.9%
ModelIterable.__iter__django/db/models/query.py:952 ms3.9%
SQLCompiler.execute_sqldjango/db/models/sql/compiler.py:16242 ms3.9%
CursorWrapper.executedjango/db/backends/utils.py:792 ms3.9%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:922 ms3.9%
CursorWrapper._executedjango/db/backends/utils.py:1052 ms3.9%
Cursor.executepsycopg/cursor.py:1132 ms3.9%
Connection.waitpsycopg/connection.py:4952 ms3.9%
mcpapps/mcp/urls.py:1254 ms7.8%
authenticateapps/mcp/urls.py:55 project = Project.objects.filter(secrettokens__token=token).first()2 ms3.9%
QuerySet.firstdjango/db/models/query.py:11452 ms3.9%
QuerySet.__iter__django/db/models/query.py:3902 ms3.9%
QuerySet._fetch_alldjango/db/models/query.py:20002 ms3.9%
ModelIterable.__iter__django/db/models/query.py:952 ms3.9%
SQLCompiler.execute_sqldjango/db/models/sql/compiler.py:16242 ms3.9%
CursorWrapper.executedjango/db/backends/utils.py:792 ms3.9%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:922 ms3.9%
CursorWrapper._executedjango/db/backends/utils.py:1052 ms3.9%
Cursor.executepsycopg/cursor.py:1132 ms3.9%
Connection.waitpsycopg/connection.py:4952 ms3.9%
authenticateapps/mcp/urls.py:57 SecretTokens.objects.filter(token=token).update(date_last_used=timezone.now())2 ms3.9%
QuerySet.updatedjango/db/models/query.py:13002 ms3.9%
SQLUpdateCompiler.execute_sqldjango/db/models/sql/compiler.py:21112 ms3.9%
SQLCompiler.execute_sqldjango/db/models/sql/compiler.py:16242 ms3.9%
CursorWrapper.executedjango/db/backends/utils.py:792 ms3.9%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:922 ms3.9%
CursorWrapper._executedjango/db/backends/utils.py:1052 ms3.9%
Cursor.executepsycopg/cursor.py:1132 ms3.9%
Connection.waitpsycopg/connection.py:4952 ms3.9%
TransactionTestCase._post_teardowndjango/test/testcases.py:1240 self._fixture_teardown()4 ms7.8%
TestCase._fixture_teardowndjango/test/testcases.py:14942 ms3.9%
TestCase._should_check_constraintsdjango/test/testcases.py:15032 ms3.9%
DatabaseWrapper.is_usabledjango/db/backends/postgresql/base.py:4922 ms3.9%
Cursor.executepsycopg/cursor.py:1132 ms3.9%
Connection.waitpsycopg/connection.py:4952 ms3.9%
TestCase._fixture_teardowndjango/test/testcases.py:14952 ms3.9%
DatabaseWrapper.check_constraintsdjango/db/backends/postgresql/base.py:4832 ms3.9%
CursorWrapper.executedjango/db/backends/utils.py:792 ms3.9%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:922 ms3.9%
CursorWrapper._executedjango/db/backends/utils.py:1032 ms3.9%
Cursor.executepsycopg/cursor.py:1132 ms3.9%
Connection.waitpsycopg/connection.py:4952 ms3.9%
Estimated from 25 samples; phase durations are exact. Frames from pytest and pluggy are hidden .

Hot lines in your code

apps/mcp/tests.py:66
return self.client.post(
McpTest.post · Libraries
26 ms
apps/projects/analytics.py:631
for row in daily_totals(rows)
averages_by_test · Database
6 ms
apps/projects/analytics.py:695
summaries = list(
compare.<locals>.side_summary · Database
4 ms
apps/mcp/urls.py:55
project = Project.objects.filter(secrettokens__token=token).first()
authenticate · Database
2 ms
apps/mcp/urls.py:57
SecretTokens.objects.filter(token=token).update(date_last_used=timezone.now())
authenticate · Database
2 ms
apps/projects/analytics.py:198
selected = Environment.objects.filter(project=project, name=env).first()
resolve_scope · Database
2 ms
apps/projects/analytics.py:406
return rows.values("test_id", "test__name", "test__slug").annotate(
daily_totals · Database
2 ms
apps/projects/analytics.py:696
Profile.objects.filter(
compare.<locals>.side_summary · Database
2 ms
apps/projects/models.py:59
return reverse(name, args=[self.organization.slug, self.slug, *args])
Project.url · Database
2 ms

Fixtures

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

Database

18 queries · 9 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:244
49 ms
call _post_teardown
django/test/testcases.py:1240
4 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
46 minutes ago CI github-actions:test passed 54 ms 9caa567 main Profile
an hour ago CI github-actions:test passed 52 ms ec75501 main Profile
7 hours ago CI github-actions:test passed 56 ms d2c12e5 main Profile
8 hours ago CI github-actions:test passed 27 ms 0b902f6 main Profile
8 hours ago CI github-actions:test passed 52 ms 78a4357 main Profile