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

LegacyUrlTest::test_private_projects_stay_private

First seen 1 month, 1 week ago in 78a4357
CI github-actions:test 15 runs
Average
49 ms
median 52 ms
max 78 ms
Phases
Setup 0.67 ms Call 47 ms Teardown 1 ms
Categories
Database 20 ms App code 0.05 ms Password hashing 0.05 ms Other (Libraries, Unsampled, pytest, Deep copies, ...) 29 ms

27 database queries per run

Needs 447 KB of memory (max 824 KB)

Duration per run

Where the time goes

Latest run in ci:github-actions:test, 2 weeks ago · open run
Show pytest frames
call40 ms97.3%
LegacyUrlTest.test_private_projects_stay_privateapps/projects/tests.py:397 response = self.client.get(f"/projects/{self.project.id}/")23 ms56.3%
Client.getdjango/test/client.py:112423 ms56.3%
RequestFactory.getdjango/test/client.py:47523 ms56.3%
RequestFactory.genericdjango/test/client.py:67123 ms56.3%
Client.requestdjango/test/client.py:108223 ms56.3%
ClientHandler.__call__django/test/client.py:17319 ms46.1%
BaseHandler.load_middlewaredjango/core/handlers/base.py:6219 ms46.1%
WhiteNoiseMiddleware.__init__whitenoise/middleware.py:10419 ms46.1%
WhiteNoise.add_fileswhitenoise/base.py:10819 ms46.1%
WhiteNoise.update_files_dictionarywhitenoise/base.py:12015 ms35.8%
WhiteNoise.add_file_to_dictionarywhitenoise/base.py:13113 ms30.7%
WhiteNoise.get_static_filewhitenoise/base.py:20810 ms25.6%
StaticFile.__init__whitenoise/responders.py:724 ms10.2%
StaticFile.get_file_statswhitenoise/responders.py:1614 ms10.2%
StaticFile.__init__whitenoise/responders.py:732 ms5.1%
StaticFile.get_headerswhitenoise/responders.py:1702 ms5.1%
StaticFile.__init__whitenoise/responders.py:762 ms5.1%
StaticFile.get_not_modified_responsewhitenoise/responders.py:1892 ms5.1%
Headers.__getitem__<stdlib>/wsgiref/headers.py:832 ms5.1%
Headers.get<stdlib>/wsgiref/headers.py:1062 ms5.1%
StaticFile.__init__whitenoise/responders.py:742 ms5.1%
Headers.__getitem__<stdlib>/wsgiref/headers.py:832 ms5.1%
WhiteNoise.get_static_filewhitenoise/base.py:2022 ms5.1%
WhiteNoise.add_mime_headerswhitenoise/base.py:2212 ms5.1%
WhiteNoise.update_files_dictionarywhitenoise/base.py:1152 ms5.1%
scantreewhitenoise/base.py:2622 ms5.1%
scantreewhitenoise/base.py:2622 ms5.1%
scantreewhitenoise/base.py:2622 ms5.1%
scantreewhitenoise/base.py:2622 ms5.1%
scantreewhitenoise/base.py:2642 ms5.1%
<GC>~2 ms5.1%
ClientHandler.__call__django/test/client.py:1864 ms10.2%
BaseHandler.get_responsedjango/core/handlers/base.py:1414 ms10.2%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:554 ms10.2%
DebugToolbarMiddleware.__call__debug_toolbar/middleware.py:1304 ms10.2%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:554 ms10.2%
MiddlewareMixin.__call__django/utils/deprecation.py:3094 ms10.2%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:554 ms10.2%
WhiteNoiseMiddleware.__call__whitenoise/middleware.py:1234 ms10.2%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:554 ms10.2%
MiddlewareMixin.__call__django/utils/deprecation.py:3094 ms10.2%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:554 ms10.2%
MiddlewareMixin.__call__django/utils/deprecation.py:3094 ms10.2%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:554 ms10.2%
MiddlewareMixin.__call__django/utils/deprecation.py:3094 ms10.2%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:554 ms10.2%
MiddlewareMixin.__call__django/utils/deprecation.py:3094 ms10.2%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:554 ms10.2%
MiddlewareMixin.__call__django/utils/deprecation.py:3094 ms10.2%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:554 ms10.2%
MiddlewareMixin.__call__django/utils/deprecation.py:3094 ms10.2%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:554 ms10.2%
AccountMiddleware.<locals>.middlewareallauth/account/middleware.py:344 ms10.2%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:554 ms10.2%
BaseHandler._get_responsedjango/core/handlers/base.py:1984 ms10.2%
legacy_redirectapps/projects/urls.py:670 project = get_object_or_404(Project.objects.select_related("organization"), pk=project_id)4 ms10.2%
get_object_or_404django/shortcuts.py:904 ms10.2%
QuerySet.getdjango/db/models/query.py:6354 ms10.2%
QuerySet.__len__django/db/models/query.py:3724 ms10.2%
QuerySet._fetch_alldjango/db/models/query.py:20004 ms10.2%
ModelIterable.__iter__django/db/models/query.py:954 ms10.2%
SQLCompiler.execute_sqldjango/db/models/sql/compiler.py:16112 ms5.1%
SQLCompiler.as_sqldjango/db/models/sql/compiler.py:7672 ms5.1%
SQLCompiler.pre_sql_setupdjango/db/models/sql/compiler.py:862 ms5.1%
SQLCompiler.execute_sqldjango/db/models/sql/compiler.py:16622 ms5.1%
cursor_iterdjango/db/models/sql/compiler.py:22542 ms5.1%
cursor_iter.<locals>.<lambda>django/db/models/sql/compiler.py:22542 ms5.1%
DatabaseErrorWrapper.__call__.<locals>.innerdjango/db/utils.py:1012 ms5.1%
Cursor.fetchmanypsycopg/cursor.py:2682 ms5.1%
BaseTzLoader.loaddjango/db/backends/postgresql/psycopg_any.py:342 ms5.1%
TimestamptzLoader.loadpsycopg/types/datetime.py:4942 ms5.1%
TimestamptzLoader._load_isopsycopg/types/datetime.py:5172 ms5.1%
LegacyUrlTest.test_private_projects_stay_privateapps/projects/tests.py:399 self.client.force_login(User.objects.create_user("stranger"))8 ms20.5%
ClientMixin.force_logindjango/test/client.py:8556 ms15.4%
ClientMixin._logindjango/test/client.py:8814 ms10.2%
logindjango/contrib/auth/__init__.py:1874 ms10.2%
SessionBase.cycle_keydjango/contrib/sessions/backends/base.py:4342 ms5.1%
SessionStore.createdjango/contrib/sessions/backends/db.py:742 ms5.1%
SessionStore.savedjango/contrib/sessions/backends/db.py:1262 ms5.1%
Atomic.__enter__django/db/transaction.py:2112 ms5.1%
async_unsafe.<locals>.decorator.<locals>.innerdjango/utils/asyncio.py:262 ms5.1%
BaseDatabaseWrapper.savepointdjango/db/backends/base/base.py:4002 ms5.1%
BaseDatabaseWrapper._savepointdjango/db/backends/base/base.py:3662 ms5.1%
async_unsafe.<locals>.decorator.<locals>.innerdjango/utils/asyncio.py:262 ms5.1%
SessionBase.cycle_keydjango/contrib/sessions/backends/base.py:4372 ms5.1%
SessionStore.deletedjango/contrib/sessions/backends/db.py:1752 ms5.1%
Model.deletedjango/db/models/base.py:12972 ms5.1%
Collector.collectdjango/db/models/deletion.py:2822 ms5.1%
Collector.adddjango/db/models/deletion.py:1312 ms5.1%
ClientMixin._logindjango/test/client.py:8762 ms5.1%
ClientMixin.sessiondjango/test/client.py:8122 ms5.1%
SessionStore.savedjango/contrib/sessions/backends/db.py:1212 ms5.1%
SessionStore.createdjango/contrib/sessions/backends/db.py:742 ms5.1%
SessionStore.savedjango/contrib/sessions/backends/db.py:1262 ms5.1%
Atomic.__enter__django/db/transaction.py:2112 ms5.1%
async_unsafe.<locals>.decorator.<locals>.innerdjango/utils/asyncio.py:262 ms5.1%
BaseDatabaseWrapper.savepointdjango/db/backends/base/base.py:4002 ms5.1%
BaseDatabaseWrapper._savepointdjango/db/backends/base/base.py:3662 ms5.1%
async_unsafe.<locals>.decorator.<locals>.innerdjango/utils/asyncio.py:262 ms5.1%
BaseDatabaseWrapper.cursordjango/db/backends/base/base.py:3202 ms5.1%
BaseDatabaseWrapper._cursordjango/db/backends/base/base.py:2982 ms5.1%
UserManager.create_userdjango/contrib/auth/models.py:1752 ms5.1%
UserManager._create_userdjango/contrib/auth/models.py:1632 ms5.1%
AbstractBaseUser.savedjango/contrib/auth/base_user.py:622 ms5.1%
Model.savedjango/db/models/base.py:8742 ms5.1%
Model.save_basedjango/db/models/base.py:9662 ms5.1%
Model._save_tabledjango/db/models/base.py:11672 ms5.1%
Model._do_insertdjango/db/models/base.py:12182 ms5.1%
BaseManager._get_queryset_methods.<locals>.create_method.<locals>.manager_methoddjango/db/models/manager.py:872 ms5.1%
QuerySet._insertdjango/db/models/query.py:19182 ms5.1%
SQLInsertCompiler.execute_sqldjango/db/models/sql/compiler.py:19252 ms5.1%
CursorWrapper.executedjango/db/backends/utils.py:792 ms5.1%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:922 ms5.1%
CursorWrapper._executedjango/db/backends/utils.py:1052 ms5.1%
Cursor.executepsycopg/cursor.py:1132 ms5.1%
Connection.waitpsycopg/connection.py:4952 ms5.1%
LegacyUrlTest.test_private_projects_stay_privateapps/projects/tests.py:400 self.assertEqual(self.client.get(f"/projects/{self.project.id}/").status_code, 404)6 ms15.4%
Client.getdjango/test/client.py:11246 ms15.4%
RequestFactory.getdjango/test/client.py:4756 ms15.4%
RequestFactory.genericdjango/test/client.py:6716 ms15.4%
Client.requestdjango/test/client.py:10826 ms15.4%
ClientHandler.__call__django/test/client.py:1866 ms15.4%
BaseHandler.get_responsedjango/core/handlers/base.py:1416 ms15.4%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:556 ms15.4%
DebugToolbarMiddleware.__call__debug_toolbar/middleware.py:1306 ms15.4%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:556 ms15.4%
MiddlewareMixin.__call__django/utils/deprecation.py:3096 ms15.4%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:556 ms15.4%
WhiteNoiseMiddleware.__call__whitenoise/middleware.py:1236 ms15.4%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:556 ms15.4%
MiddlewareMixin.__call__django/utils/deprecation.py:3096 ms15.4%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:556 ms15.4%
MiddlewareMixin.__call__django/utils/deprecation.py:3096 ms15.4%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:556 ms15.4%
MiddlewareMixin.__call__django/utils/deprecation.py:3096 ms15.4%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:556 ms15.4%
MiddlewareMixin.__call__django/utils/deprecation.py:3096 ms15.4%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:556 ms15.4%
MiddlewareMixin.__call__django/utils/deprecation.py:3096 ms15.4%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:556 ms15.4%
MiddlewareMixin.__call__django/utils/deprecation.py:3096 ms15.4%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:556 ms15.4%
AccountMiddleware.<locals>.middlewareallauth/account/middleware.py:346 ms15.4%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:556 ms15.4%
BaseHandler._get_responsedjango/core/handlers/base.py:1984 ms10.2%
legacy_redirectapps/projects/urls.py:6754 ms10.2%
can_viewapps/projects/urls.py:334 ms10.2%
can_manage_projectapps/projects/urls.py:38 if not user.is_authenticated:4 ms10.2%
new_method_proxy.<locals>.innerdjango/utils/functional.py:2514 ms10.2%
SimpleLazyObject._setupdjango/utils/functional.py:4044 ms10.2%
AuthenticationMiddleware.process_request.<locals>.<lambda>django/contrib/auth/middleware.py:404 ms10.2%
get_userdjango/contrib/auth/middleware.py:204 ms10.2%
get_userdjango/contrib/auth/__init__.py:3112 ms5.1%
_get_user_session_keydjango/contrib/auth/__init__.py:952 ms5.1%
SessionBase.__getitem__django/contrib/sessions/backends/base.py:552 ms5.1%
SessionBase._get_sessiondjango/contrib/sessions/backends/base.py:2512 ms5.1%
SessionStore.loaddjango/contrib/sessions/backends/db.py:552 ms5.1%
SessionStore._get_session_from_dbdjango/contrib/sessions/backends/db.py:342 ms5.1%
BaseManager._get_queryset_methods.<locals>.create_method.<locals>.manager_methoddjango/db/models/manager.py:872 ms5.1%
QuerySet.getdjango/db/models/query.py:6252 ms5.1%
QuerySet.filterdjango/db/models/query.py:15422 ms5.1%
QuerySet._filter_or_excludedjango/db/models/query.py:15602 ms5.1%
QuerySet._filter_or_exclude_inplacedjango/db/models/query.py:15702 ms5.1%
Query.add_qdjango/db/models/sql/query.py:16712 ms5.1%
Query._add_qdjango/db/models/sql/query.py:17032 ms5.1%
get_userdjango/contrib/auth/__init__.py:3182 ms5.1%
ModelBackend.get_userdjango/contrib/auth/backends.py:2322 ms5.1%
BaseManager._get_queryset_methods.<locals>.create_method.<locals>.manager_methoddjango/db/models/manager.py:872 ms5.1%
QuerySet.getdjango/db/models/query.py:6352 ms5.1%
QuerySet.__len__django/db/models/query.py:3722 ms5.1%
QuerySet._fetch_alldjango/db/models/query.py:20002 ms5.1%
ModelIterable.__iter__django/db/models/query.py:952 ms5.1%
SQLCompiler.execute_sqldjango/db/models/sql/compiler.py:16242 ms5.1%
CursorWrapper.executedjango/db/backends/utils.py:792 ms5.1%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:922 ms5.1%
CursorWrapper._executedjango/db/backends/utils.py:1052 ms5.1%
Cursor.executepsycopg/cursor.py:1132 ms5.1%
Connection.waitpsycopg/connection.py:4952 ms5.1%
BaseHandler._get_responsedjango/core/handlers/base.py:1822 ms5.1%
BaseHandler.resolve_requestdjango/core/handlers/base.py:3142 ms5.1%
URLResolver.resolvedjango/urls/resolvers.py:6802 ms5.1%
TransactionTestCase._post_teardowndjango/test/testcases.py:1240 self._fixture_teardown()2 ms5.1%
TestCase._fixture_teardowndjango/test/testcases.py:14942 ms5.1%
TestCase._should_check_constraintsdjango/test/testcases.py:15032 ms5.1%
DatabaseWrapper.is_usabledjango/db/backends/postgresql/base.py:4912 ms5.1%
Connection.cursorpsycopg/connection.py:2592 ms5.1%
Cursor.__init__psycopg/cursor.py:472 ms5.1%
Estimated from 19 samples; phase durations are exact. Frames from pytest and pluggy are hidden .

Hot lines in your code

apps/projects/tests.py:397
response = self.client.get(f"/projects/{self.project.id}/")
LegacyUrlTest.test_private_projects_stay_private · Libraries
19 ms
apps/projects/tests.py:399
self.client.force_login(User.objects.create_user("stranger"))
LegacyUrlTest.test_private_projects_stay_private · Database
8 ms
apps/projects/urls.py:670
project = get_object_or_404(Project.objects.select_related("organization"), pk=project_id)
legacy_redirect · Database
4 ms
apps/projects/urls.py:38
if not user.is_authenticated:
can_manage_project · Database
4 ms
apps/projects/tests.py:400
self.assertEqual(self.client.get(f"/projects/{self.project.id}/").status_code, 404)
LegacyUrlTest.test_private_projects_stay_private · Libraries
2 ms

Fixtures

Exact setup time
_dj_autoclear_mailbox function 0.06 ms
_django_db_marker function 0.03 ms
_template_string_if_invalid_marker function 0.03 ms
_django_set_urlconf function 0.03 ms
_live_server_helper function 0.03 ms
_django_clear_site_cache function 0.02 ms
monkeypatch function 0.01 ms

Database

27 queries · 6 ms

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

3×
SELECT "projects_project"."id", "projects_project"."organization_id", "projects_project"."name", "projects_project"."slug", "projects_project"."public", "projects_project"."description", "projects_project"."date_created", "projects_project"."date_updated", "projects_project"."created_by_id", "orgs_…

Biggest pieces of work

call test body
apps/projects/tests.py:397
38 ms
call _post_teardown
django/test/testcases.py:1240
2 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 41 ms cb18ed3 main Profile
2 weeks, 4 days ago CI github-actions:test passed 57 ms 9bd5864 main Profile
2 weeks, 6 days ago CI github-actions:test passed 31 ms 19dac9b main Profile
3 weeks ago CI github-actions:test passed 59 ms e141198 main Profile
1 month ago CI github-actions:test passed 47 ms 46ec2aa main Profile
1 month ago CI github-actions:test passed 60 ms afde85b main Profile
1 month ago CI github-actions:test passed 35 ms fe29f9d main Profile
1 month ago CI github-actions:test passed 78 ms 044719a main Profile
1 month ago CI github-actions:test passed 31 ms b3fedae main Profile
1 month, 1 week ago CI github-actions:test passed 55 ms 43c4eda main Profile
1 month, 1 week ago CI github-actions:test passed 53 ms 9caa567 main Profile
1 month, 1 week ago CI github-actions:test passed 52 ms ec75501 main Profile
1 month, 1 week ago CI github-actions:test passed 58 ms d2c12e5 main Profile
1 month, 1 week ago CI github-actions:test passed 27 ms 0b902f6 main Profile
1 month, 1 week ago CI github-actions:test passed 52 ms 78a4357 main Profile