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

ProjectPagesTest::test_dashboard_other_users_project

First seen 3 weeks ago in 78a4357
CI github-actions:test 12 runs
Average
54 ms
median 60 ms
max 77 ms
Phases
Setup 0.66 ms Call 53 ms Teardown 0.16 ms
Categories
Database 29 ms App code 0.34 ms Other (Libraries, Unsampled, Logging, pytest, ...) 24 ms

34 database queries per run

Needs 71 KB of memory (max 608 KB)

Duration per run

Where the time goes

Latest run in ci:github-actions:test, 16 hours ago · open run
Show pytest frames
call62 ms98.6%
ProjectPagesTest.test_dashboard_other_users_projectapps/projects/tests.py:991 response = self.client.get(self.project.url("project_dashboard"))44 ms69.6%
Client.getdjango/test/client.py:112444 ms69.6%
RequestFactory.getdjango/test/client.py:47544 ms69.6%
RequestFactory.genericdjango/test/client.py:67144 ms69.6%
Client.requestdjango/test/client.py:108244 ms69.6%
ClientHandler.__call__django/test/client.py:18636 ms58.0%
BaseHandler.get_responsedjango/core/handlers/base.py:14136 ms58.0%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5536 ms58.0%
DebugToolbarMiddleware.__call__debug_toolbar/middleware.py:13036 ms58.0%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5536 ms58.0%
MiddlewareMixin.__call__django/utils/deprecation.py:30936 ms58.0%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5536 ms58.0%
WhiteNoiseMiddleware.__call__whitenoise/middleware.py:12336 ms58.0%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5536 ms58.0%
MiddlewareMixin.__call__django/utils/deprecation.py:30936 ms58.0%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5536 ms58.0%
MiddlewareMixin.__call__django/utils/deprecation.py:30936 ms58.0%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5536 ms58.0%
MiddlewareMixin.__call__django/utils/deprecation.py:30936 ms58.0%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5536 ms58.0%
MiddlewareMixin.__call__django/utils/deprecation.py:30936 ms58.0%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5536 ms58.0%
MiddlewareMixin.__call__django/utils/deprecation.py:30936 ms58.0%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5536 ms58.0%
MiddlewareMixin.__call__django/utils/deprecation.py:30936 ms58.0%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5536 ms58.0%
AccountMiddleware.<locals>.middlewareallauth/account/middleware.py:3435 ms55.1%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5533 ms52.2%
BaseHandler._get_responsedjango/core/handlers/base.py:19831 ms49.3%
project_dashboardapps/projects/urls.py:13231 ms49.3%
find_projectapps/projects/urls.py:49 project = get_object_or_404(31 ms49.3%
get_object_or_404django/shortcuts.py:9031 ms49.3%
QuerySet.getdjango/db/models/query.py:63527 ms43.5%
QuerySet.__len__django/db/models/query.py:37227 ms43.5%
QuerySet._fetch_alldjango/db/models/query.py:200027 ms43.5%
ModelIterable.__iter__django/db/models/query.py:9522 ms34.8%
SQLCompiler.execute_sqldjango/db/models/sql/compiler.py:162420 ms31.9%
CursorWrapper.executedjango/db/backends/utils.py:7920 ms31.9%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:9220 ms31.9%
CursorWrapper._executedjango/db/backends/utils.py:10520 ms31.9%
Cursor.executepsycopg/cursor.py:11320 ms31.9%
Connection.waitpsycopg/connection.py:49520 ms31.9%
BaseCursor._execute_genpsycopg/_cursor_base.py:20618 ms29.0%
BaseCursor._maybe_prepare_genpsycopg/_cursor_base.py:28618 ms29.0%
ClientCursorMixin._execute_sendpsycopg/client_cursor.py:7818 ms29.0%
BaseCursor._execute_genpsycopg/_cursor_base.py:2052 ms2.9%
BaseCursor._convert_querypsycopg/_cursor_base.py:4652 ms2.9%
SQLCompiler.execute_sqldjango/db/models/sql/compiler.py:16112 ms2.9%
SQLCompiler.as_sqldjango/db/models/sql/compiler.py:7922 ms2.9%
SQLCompiler.get_from_clausedjango/db/models/sql/compiler.py:11592 ms2.9%
SQLCompiler.compiledjango/db/models/sql/compiler.py:5782 ms2.9%
Join.as_sqldjango/db/models/sql/datastructures.py:882 ms2.9%
DatabaseOperations.prepare_join_on_clausedjango/db/backends/postgresql/operations.py:3992 ms2.9%
ForeignKey.db_typedjango/db/models/fields/related.py:12232 ms2.9%
ModelIterable.__iter__django/db/models/query.py:925 ms8.7%
SQLCompiler.execute_sqldjango/db/models/sql/compiler.py:16114 ms5.8%
SQLCompiler.as_sqldjango/db/models/sql/compiler.py:7674 ms5.8%
SQLCompiler.pre_sql_setupdjango/db/models/sql/compiler.py:864 ms5.8%
SQLCompiler.setup_querydjango/db/models/sql/compiler.py:754 ms5.8%
SQLCompiler.get_selectdjango/db/models/sql/compiler.py:3002 ms2.9%
SQLCompiler.get_related_selectionsdjango/db/models/sql/compiler.py:12592 ms2.9%
SQLCompiler.get_default_columnsdjango/db/models/sql/compiler.py:10302 ms2.9%
SQLCompiler.get_selectdjango/db/models/sql/compiler.py:3172 ms2.9%
SQLCompiler.compiledjango/db/models/sql/compiler.py:5782 ms2.9%
Col.as_sqldjango/db/models/expressions.py:13252 ms2.9%
SQLCompiler.quote_name_unless_aliasdjango/db/backends/postgresql/compiler.py:342 ms2.9%
SQLCompiler.quote_name_unless_aliasdjango/db/models/sql/compiler.py:5692 ms2.9%
Query.get_compilerdjango/db/models/sql/query.py:3692 ms2.9%
QuerySet.getdjango/db/models/query.py:6254 ms5.8%
QuerySet.filterdjango/db/models/query.py:15424 ms5.8%
QuerySet._filter_or_excludedjango/db/models/query.py:15604 ms5.8%
QuerySet._filter_or_exclude_inplacedjango/db/models/query.py:15704 ms5.8%
Query.add_qdjango/db/models/sql/query.py:16714 ms5.8%
Query._add_qdjango/db/models/sql/query.py:17034 ms5.8%
Query.build_filterdjango/db/models/sql/query.py:15512 ms2.9%
Query.solve_lookup_typedjango/db/models/sql/query.py:13582 ms2.9%
Query.names_to_pathdjango/db/models/sql/query.py:17862 ms2.9%
Query.build_filterdjango/db/models/sql/query.py:16112 ms2.9%
Query._get_coldjango/db/models/sql/query.py:4512 ms2.9%
BaseHandler._get_responsedjango/core/handlers/base.py:1822 ms2.9%
BaseHandler.resolve_requestdjango/core/handlers/base.py:3142 ms2.9%
URLResolver.resolvedjango/urls/resolvers.py:6782 ms2.9%
URLPattern.resolvedjango/urls/resolvers.py:4722 ms2.9%
RoutePattern.matchdjango/urls/resolvers.py:3262 ms2.9%
AccountMiddleware.<locals>.middlewareallauth/account/middleware.py:352 ms2.9%
_should_redirect_accountsallauth/account/middleware.py:682 ms2.9%
reversedjango/urls/base.py:982 ms2.9%
URLResolver._reverse_with_prefixdjango/urls/resolvers.py:7622 ms2.9%
ClientHandler.__call__django/test/client.py:1737 ms11.6%
BaseHandler.load_middlewaredjango/core/handlers/base.py:627 ms11.6%
WhiteNoiseMiddleware.__init__whitenoise/middleware.py:1047 ms11.6%
WhiteNoise.add_fileswhitenoise/base.py:1087 ms11.6%
WhiteNoise.update_files_dictionarywhitenoise/base.py:1154 ms5.8%
scantreewhitenoise/base.py:2624 ms5.8%
scantreewhitenoise/base.py:2624 ms5.8%
scantreewhitenoise/base.py:2622 ms2.9%
scantreewhitenoise/base.py:2622 ms2.9%
scantreewhitenoise/base.py:2622 ms2.9%
scantreewhitenoise/base.py:2642 ms2.9%
scantreewhitenoise/base.py:2642 ms2.9%
WhiteNoise.update_files_dictionarywhitenoise/base.py:1204 ms5.8%
WhiteNoise.add_file_to_dictionarywhitenoise/base.py:1314 ms5.8%
WhiteNoise.get_static_filewhitenoise/base.py:2082 ms2.9%
StaticFile.__init__whitenoise/responders.py:732 ms2.9%
StaticFile.get_headerswhitenoise/responders.py:1812 ms2.9%
WhiteNoise.get_static_filewhitenoise/base.py:2032 ms2.9%
WhiteNoise.add_cache_headerswhitenoise/base.py:2242 ms2.9%
WhiteNoiseMiddleware.immutable_file_testwhitenoise/middleware.py:1762 ms2.9%
TransactionTestCase._post_teardowndjango/test/testcases.py:1240 self._fixture_teardown()5 ms8.7%
TestCase._fixture_teardowndjango/test/testcases.py:14955 ms8.7%
DatabaseWrapper.check_constraintsdjango/db/backends/postgresql/base.py:4835 ms8.7%
CursorWrapper.executedjango/db/backends/utils.py:795 ms8.7%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:925 ms8.7%
CursorWrapper._executedjango/db/backends/utils.py:1035 ms8.7%
Cursor.executepsycopg/cursor.py:1135 ms8.7%
Connection.waitpsycopg/connection.py:4955 ms8.7%
ProjectPagesTest.setUpapps/projects/tests.py:954 self.client.force_login(self.user)5 ms8.7%
ClientMixin.force_logindjango/test/client.py:8555 ms8.7%
ClientMixin._logindjango/test/client.py:8814 ms5.8%
logindjango/contrib/auth/__init__.py:1752 ms2.9%
SessionBase.__contains__django/contrib/sessions/backends/base.py:522 ms2.9%
SessionBase._get_sessiondjango/contrib/sessions/backends/base.py:2512 ms2.9%
SessionStore.loaddjango/contrib/sessions/backends/db.py:552 ms2.9%
SessionStore._get_session_from_dbdjango/contrib/sessions/backends/db.py:342 ms2.9%
BaseManager._get_queryset_methods.<locals>.create_method.<locals>.manager_methoddjango/db/models/manager.py:872 ms2.9%
QuerySet.getdjango/db/models/query.py:6352 ms2.9%
QuerySet.__len__django/db/models/query.py:3722 ms2.9%
QuerySet._fetch_alldjango/db/models/query.py:20002 ms2.9%
ModelIterable.__iter__django/db/models/query.py:952 ms2.9%
SQLCompiler.execute_sqldjango/db/models/sql/compiler.py:16242 ms2.9%
CursorWrapper.executedjango/db/backends/utils.py:792 ms2.9%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:922 ms2.9%
CursorWrapper._executedjango/db/backends/utils.py:1052 ms2.9%
Cursor.executepsycopg/cursor.py:1132 ms2.9%
Connection.waitpsycopg/connection.py:4952 ms2.9%
logindjango/contrib/auth/__init__.py:1872 ms2.9%
SessionBase.cycle_keydjango/contrib/sessions/backends/base.py:4372 ms2.9%
SessionStore.deletedjango/contrib/sessions/backends/db.py:1752 ms2.9%
BaseManager._get_queryset_methods.<locals>.create_method.<locals>.manager_methoddjango/db/models/manager.py:872 ms2.9%
QuerySet.getdjango/db/models/query.py:6352 ms2.9%
QuerySet.__len__django/db/models/query.py:3722 ms2.9%
QuerySet._fetch_alldjango/db/models/query.py:20002 ms2.9%
ModelIterable.__iter__django/db/models/query.py:952 ms2.9%
SQLCompiler.execute_sqldjango/db/models/sql/compiler.py:16222 ms2.9%
async_unsafe.<locals>.decorator.<locals>.innerdjango/utils/asyncio.py:262 ms2.9%
BaseDatabaseWrapper.cursordjango/db/backends/base/base.py:3202 ms2.9%
BaseDatabaseWrapper._cursordjango/db/backends/base/base.py:2982 ms2.9%
async_unsafe.<locals>.decorator.<locals>.innerdjango/utils/asyncio.py:262 ms2.9%
DatabaseWrapper.create_cursordjango/db/backends/postgresql/base.py:4352 ms2.9%
AdaptersMap.get_loaderpsycopg/_adapters_map.py:2732 ms2.9%
ClientMixin._logindjango/test/client.py:8762 ms2.9%
ClientMixin.sessiondjango/test/client.py:8122 ms2.9%
SessionStore.savedjango/contrib/sessions/backends/db.py:1212 ms2.9%
SessionStore.createdjango/contrib/sessions/backends/db.py:742 ms2.9%
SessionStore.savedjango/contrib/sessions/backends/db.py:1272 ms2.9%
Model.savedjango/db/models/base.py:8742 ms2.9%
Model.save_basedjango/db/models/base.py:9662 ms2.9%
Model._save_tabledjango/db/models/base.py:11672 ms2.9%
Model._do_insertdjango/db/models/base.py:12182 ms2.9%
BaseManager._get_queryset_methods.<locals>.create_method.<locals>.manager_methoddjango/db/models/manager.py:872 ms2.9%
QuerySet._insertdjango/db/models/query.py:19182 ms2.9%
SQLInsertCompiler.execute_sqldjango/db/models/sql/compiler.py:19252 ms2.9%
CursorWrapper.executedjango/db/backends/utils.py:792 ms2.9%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:922 ms2.9%
CursorWrapper._executedjango/db/backends/utils.py:1052 ms2.9%
Cursor.executepsycopg/cursor.py:1132 ms2.9%
Connection.waitpsycopg/connection.py:4952 ms2.9%
ProjectPagesTest.test_dashboard_other_users_projectapps/projects/tests.py:990 self.client.force_login(User.objects.create_user("stranger"))4 ms5.8%
ClientMixin.force_logindjango/test/client.py:8554 ms5.8%
ClientMixin._logindjango/test/client.py:8832 ms2.9%
SessionStore.savedjango/contrib/sessions/backends/db.py:1212 ms2.9%
SessionStore.createdjango/contrib/sessions/backends/db.py:702 ms2.9%
SessionBase._get_new_session_keydjango/contrib/sessions/backends/base.py:1982 ms2.9%
SessionStore.existsdjango/contrib/sessions/backends/db.py:632 ms2.9%
QuerySet.existsdjango/db/models/query.py:13372 ms2.9%
Query.has_resultsdjango/db/models/sql/query.py:6812 ms2.9%
SQLCompiler.has_resultsdjango/db/models/sql/compiler.py:15922 ms2.9%
SQLCompiler.execute_sqldjango/db/models/sql/compiler.py:16242 ms2.9%
CursorWrapper.executedjango/db/backends/utils.py:792 ms2.9%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:922 ms2.9%
CursorWrapper._executedjango/db/backends/utils.py:1052 ms2.9%
Cursor.executepsycopg/cursor.py:1132 ms2.9%
Connection.waitpsycopg/connection.py:4952 ms2.9%
ClientMixin._logindjango/test/client.py:8842 ms2.9%
ClientMixin._set_login_cookiesdjango/test/client.py:9062 ms2.9%
BaseCookie.__setitem__<stdlib>/http/cookies.py:5302 ms2.9%
ProjectPagesTest.test_dashboard_other_users_projectapps/projects/tests.py:989 Project.objects.filter(pk=self.project.pk).update(public=False)2 ms2.9%
QuerySet.updatedjango/db/models/query.py:13002 ms2.9%
SQLUpdateCompiler.execute_sqldjango/db/models/sql/compiler.py:21112 ms2.9%
SQLCompiler.execute_sqldjango/db/models/sql/compiler.py:16242 ms2.9%
CursorWrapper.executedjango/db/backends/utils.py:792 ms2.9%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:922 ms2.9%
CursorWrapper._executedjango/db/backends/utils.py:1052 ms2.9%
Cursor.executepsycopg/cursor.py:1132 ms2.9%
Connection.waitpsycopg/connection.py:4952 ms2.9%
Estimated from 34 samples; phase durations are exact. Frames from pytest and pluggy are hidden .

Hot lines in your code

apps/projects/urls.py:49
project = get_object_or_404(
find_project · Database
31 ms
apps/projects/tests.py:991
response = self.client.get(self.project.url("project_dashboard"))
ProjectPagesTest.test_dashboard_other_users_project · Libraries
13 ms
apps/projects/tests.py:954
self.client.force_login(self.user)
ProjectPagesTest.setUp · Database
5 ms
apps/projects/tests.py:990
self.client.force_login(User.objects.create_user("stranger"))
ProjectPagesTest.test_dashboard_other_users_project · Database
4 ms
apps/projects/tests.py:989
Project.objects.filter(pk=self.project.pk).update(public=False)
ProjectPagesTest.test_dashboard_other_users_project · Database
2 ms

Fixtures

Exact setup time
_dj_autoclear_mailbox function 0.05 ms
_django_db_marker 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.04 ms
_django_clear_site_cache function 0.03 ms
monkeypatch function 0.02 ms

Database

34 queries · 11 ms

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

3×
SELECT %s AS "a" FROM "django_session" WHERE "django_session"."session_key" = %s LIMIT ?
3×
INSERT INTO "django_session" ("session_key", "session_data", "expire_date") VALUES (%s, %s, %s)
3×
SELECT "django_session"."session_key", "django_session"."session_data", "django_session"."expire_date" FROM "django_session" WHERE ("django_session"."expire_date" > %s AND "django_session"."session_key" = %s) LIMIT ?

Biggest pieces of work

call test body
apps/projects/tests.py:991
49 ms
call _post_teardown
django/test/testcases.py:1240
5 ms
call setUp
apps/projects/tests.py:954
5 ms
call pytest internals 2 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 63 ms e141198 main Profile
1 week, 5 days ago CI github-actions:test passed 27 ms 46ec2aa main Profile
2 weeks, 1 day ago CI github-actions:test passed 62 ms afde85b main Profile
2 weeks, 1 day ago CI github-actions:test passed 46 ms fe29f9d main Profile
2 weeks, 1 day ago CI github-actions:test passed 77 ms 044719a main Profile
2 weeks, 2 days ago CI github-actions:test passed 37 ms b3fedae main Profile
2 weeks, 4 days ago CI github-actions:test passed 62 ms 43c4eda main Profile
2 weeks, 6 days ago CI github-actions:test passed 61 ms 9caa567 main Profile
2 weeks, 6 days ago CI github-actions:test passed 59 ms ec75501 main Profile
3 weeks ago CI github-actions:test passed 61 ms d2c12e5 main Profile
3 weeks ago CI github-actions:test passed 32 ms 0b902f6 main Profile
3 weeks ago CI github-actions:test passed 58 ms 78a4357 main Profile