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

SuperuserTest::test_superusers_can_open_any_project_but_dont_list_them

First seen 3 weeks, 6 days ago in 78a4357
CI github-actions:test 15 runs
Average
293 ms
median 308 ms
max 509 ms
Phases
Setup 17 ms Call 276 ms Teardown 0.60 ms
Categories
Password hashing 225 ms Database 44 ms App code 0.16 ms Test code 0.08 ms Other (Libraries, Templates, pytest, Unsampled) 24 ms

68 database queries per run

Needs 327 KB of memory (max 1 MB)

Duration per run

Where the time goes

Latest run in ci:github-actions:test, 10 hours ago · open run
Show pytest frames
setup14 ms5.8%
TestCase.setUpClassdjango/test/testcases.py:1423 cls.cls_atomics = cls._enter_atomics()8 ms3.4%
TestCase._enter_atomicsdjango/test/testcases.py:13968 ms3.4%
Atomic.__enter__django/db/transaction.py:1988 ms3.4%
BaseDatabaseWrapper.get_autocommitdjango/db/backends/base/base.py:4548 ms3.4%
SimpleTestCase.ensure_connection_patch_method.<locals>.patched_ensure_connectiondjango/test/testcases.py:3038 ms3.4%
async_unsafe.<locals>.decorator.<locals>.innerdjango/utils/asyncio.py:268 ms3.4%
BaseDatabaseWrapper.ensure_connectiondjango/db/backends/base/base.py:2798 ms3.4%
async_unsafe.<locals>.decorator.<locals>.innerdjango/utils/asyncio.py:268 ms3.4%
BaseDatabaseWrapper.connectdjango/db/backends/base/base.py:2568 ms3.4%
DatabaseWrapper.get_new_connectionft/db/postgresql/base.py:39 return super().get_new_connection(conn_params)8 ms3.4%
async_unsafe.<locals>.decorator.<locals>.innerdjango/utils/asyncio.py:268 ms3.4%
DatabaseWrapper.get_new_connectiondjango/db/backends/postgresql/base.py:3338 ms3.4%
Connection.connectpsycopg/connection.py:1098 ms3.4%
wait_connpsycopg/waiting.py:1415 ms1.9%
EpollSelector.select<stdlib>/selectors.py:4525 ms1.9%
wait_connpsycopg/waiting.py:1453 ms1.5%
BaseConnection._connect_genpsycopg/_connection_base.py:4393 ms1.5%
TestCase.setUpClassdjango/test/testcases.py:1439 cls.setUpTestData()5 ms1.9%
call224 ms94.0%
SuperuserTest.test_superusers_can_open_any_project_but_dont_list_themapps/orgs/tests.py:194 admin = User.objects.create_superuser("admin", "[email protected]", "pw")184 ms77.2%
UserManager.create_superuserdjango/contrib/auth/models.py:195184 ms77.2%
UserManager._create_userdjango/contrib/auth/models.py:162183 ms76.7%
UserManager._create_user_objectdjango/contrib/auth/models.py:155183 ms76.7%
make_passworddjango/contrib/auth/hashers.py:119183 ms76.7%
PBKDF2PasswordHasher.encodedjango/contrib/auth/hashers.py:335183 ms76.7%
pbkdf2django/utils/crypto.py:77183 ms76.7%
1 smaller frames hidden
SuperuserTest.test_superusers_can_open_any_project_but_dont_list_themapps/orgs/tests.py:197 self.assertEqual(self.client.get(self.project.url()).status_code, 200)12 ms4.9%
Client.getdjango/test/client.py:112412 ms4.9%
RequestFactory.getdjango/test/client.py:47512 ms4.9%
RequestFactory.genericdjango/test/client.py:67112 ms4.9%
Client.requestdjango/test/client.py:108212 ms4.9%
ClientHandler.__call__django/test/client.py:1737 ms3.0%
BaseHandler.load_middlewaredjango/core/handlers/base.py:627 ms3.0%
WhiteNoiseMiddleware.__init__whitenoise/middleware.py:1047 ms3.0%
WhiteNoise.add_fileswhitenoise/base.py:1087 ms3.0%
WhiteNoise.update_files_dictionarywhitenoise/base.py:1205 ms2.0%
WhiteNoise.add_file_to_dictionarywhitenoise/base.py:1315 ms2.0%
WhiteNoise.get_static_filewhitenoise/base.py:2084 ms1.5%
StaticFile.__init__whitenoise/responders.py:722 ms1.0%
1 smaller frames hidden
WhiteNoise.update_files_dictionarywhitenoise/base.py:1152 ms1.0%
scantreewhitenoise/base.py:2622 ms1.0%
scantreewhitenoise/base.py:2622 ms1.0%
ClientHandler.__call__django/test/client.py:1865 ms2.0%
BaseHandler.get_responsedjango/core/handlers/base.py:1415 ms2.0%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:555 ms2.0%
DebugToolbarMiddleware.__call__debug_toolbar/middleware.py:1305 ms2.0%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:555 ms2.0%
MiddlewareMixin.__call__django/utils/deprecation.py:3095 ms2.0%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:555 ms2.0%
WhiteNoiseMiddleware.__call__whitenoise/middleware.py:1235 ms2.0%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:555 ms2.0%
MiddlewareMixin.__call__django/utils/deprecation.py:3095 ms2.0%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:555 ms2.0%
MiddlewareMixin.__call__django/utils/deprecation.py:3095 ms2.0%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:555 ms2.0%
MiddlewareMixin.__call__django/utils/deprecation.py:3095 ms2.0%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:555 ms2.0%
MiddlewareMixin.__call__django/utils/deprecation.py:3095 ms2.0%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:555 ms2.0%
MiddlewareMixin.__call__django/utils/deprecation.py:3095 ms2.0%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:555 ms2.0%
MiddlewareMixin.__call__django/utils/deprecation.py:3095 ms2.0%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:555 ms2.0%
AccountMiddleware.<locals>.middlewareallauth/account/middleware.py:345 ms2.0%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:555 ms2.0%
BaseHandler._get_responsedjango/core/handlers/base.py:1985 ms2.0%
project_dashboardapps/projects/urls.py:1322 ms1.0%
2 smaller frames hidden
SuperuserTest.test_superusers_can_open_any_project_but_dont_list_themapps/orgs/tests.py:199 response = self.client.get(reverse("projects"), follow=True)12 ms4.9%
Client.getdjango/test/client.py:11337 ms3.0%
Client._handle_redirectsdjango/test/client.py:13847 ms3.0%
ClientMixin._follow_redirectdjango/test/client.py:10027 ms3.0%
Client.getdjango/test/client.py:11247 ms3.0%
RequestFactory.getdjango/test/client.py:4757 ms3.0%
RequestFactory.genericdjango/test/client.py:6717 ms3.0%
Client.requestdjango/test/client.py:10827 ms3.0%
ClientHandler.__call__django/test/client.py:1866 ms2.5%
BaseHandler.get_responsedjango/core/handlers/base.py:1416 ms2.5%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:556 ms2.5%
DebugToolbarMiddleware.__call__debug_toolbar/middleware.py:1306 ms2.5%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:556 ms2.5%
MiddlewareMixin.__call__django/utils/deprecation.py:3096 ms2.5%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:556 ms2.5%
WhiteNoiseMiddleware.__call__whitenoise/middleware.py:1236 ms2.5%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:556 ms2.5%
MiddlewareMixin.__call__django/utils/deprecation.py:3096 ms2.5%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:556 ms2.5%
MiddlewareMixin.__call__django/utils/deprecation.py:3096 ms2.5%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:556 ms2.5%
MiddlewareMixin.__call__django/utils/deprecation.py:3096 ms2.5%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:556 ms2.5%
MiddlewareMixin.__call__django/utils/deprecation.py:3096 ms2.5%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:556 ms2.5%
MiddlewareMixin.__call__django/utils/deprecation.py:3096 ms2.5%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:556 ms2.5%
MiddlewareMixin.__call__django/utils/deprecation.py:3096 ms2.5%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:556 ms2.5%
AccountMiddleware.<locals>.middlewareallauth/account/middleware.py:346 ms2.5%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:556 ms2.5%
BaseHandler._get_responsedjango/core/handlers/base.py:1986 ms2.5%
project_dashboardapps/projects/urls.py:1352 ms1.0%
shellapps/projects/urls.py:71 return org_shell(request, project.organization if project else None, section) | {2 ms1.0%
project_dashboardapps/projects/urls.py:138 return render(request, "project_setup.html", context)2 ms1.0%
renderdjango/shortcuts.py:252 ms1.0%
render_to_stringdjango/template/loader.py:622 ms1.0%
Template.renderdjango/template/backends/django.py:1072 ms1.0%
Template.renderdjango/template/base.py:1742 ms1.0%
instrumented_test_renderdjango/test/utils.py:1142 ms1.0%
NodeList.renderdjango/template/base.py:10912 ms1.0%
Node.render_annotateddjango/template/base.py:10522 ms1.0%
ExtendsNode.renderdjango/template/loader_tags.py:1602 ms1.0%
instrumented_test_renderdjango/test/utils.py:1142 ms1.0%
NodeList.renderdjango/template/base.py:10912 ms1.0%
Node.render_annotateddjango/template/base.py:10522 ms1.0%
ExtendsNode.renderdjango/template/loader_tags.py:1602 ms1.0%
instrumented_test_renderdjango/test/utils.py:1142 ms1.0%
NodeList.renderdjango/template/base.py:10912 ms1.0%
Node.render_annotateddjango/template/base.py:10522 ms1.0%
BlockNode.renderdjango/template/loader_tags.py:662 ms1.0%
NodeList.renderdjango/template/base.py:10912 ms1.0%
Node.render_annotateddjango/template/base.py:10522 ms1.0%
1 smaller frames hidden
1 smaller frames hidden
Client.getdjango/test/client.py:11245 ms2.0%
RequestFactory.getdjango/test/client.py:4755 ms2.0%
RequestFactory.genericdjango/test/client.py:6715 ms2.0%
Client.requestdjango/test/client.py:10825 ms2.0%
ClientHandler.__call__django/test/client.py:1865 ms2.0%
BaseHandler.get_responsedjango/core/handlers/base.py:1415 ms2.0%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:555 ms2.0%
DebugToolbarMiddleware.__call__debug_toolbar/middleware.py:1305 ms2.0%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:555 ms2.0%
MiddlewareMixin.__call__django/utils/deprecation.py:3095 ms2.0%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:555 ms2.0%
WhiteNoiseMiddleware.__call__whitenoise/middleware.py:1235 ms2.0%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:555 ms2.0%
MiddlewareMixin.__call__django/utils/deprecation.py:3095 ms2.0%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:555 ms2.0%
MiddlewareMixin.__call__django/utils/deprecation.py:3095 ms2.0%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:555 ms2.0%
MiddlewareMixin.__call__django/utils/deprecation.py:3095 ms2.0%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:555 ms2.0%
MiddlewareMixin.__call__django/utils/deprecation.py:3095 ms2.0%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:555 ms2.0%
MiddlewareMixin.__call__django/utils/deprecation.py:3095 ms2.0%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:555 ms2.0%
MiddlewareMixin.__call__django/utils/deprecation.py:3095 ms2.0%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:555 ms2.0%
AccountMiddleware.<locals>.middlewareallauth/account/middleware.py:345 ms2.0%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:555 ms2.0%
BaseHandler._get_responsedjango/core/handlers/base.py:1985 ms2.0%
user_passes_test.<locals>.decorator.<locals>._view_wrapperdjango/contrib/auth/decorators.py:594 ms1.5%
1 smaller frames hidden
SuperuserTest.test_superusers_can_open_any_project_but_dont_list_themapps/orgs/tests.py:196 self.client.force_login(admin)6 ms2.5%
ClientMixin.force_logindjango/test/client.py:8556 ms2.5%
ClientMixin._logindjango/test/client.py:8814 ms1.5%
ClientMixin._logindjango/test/client.py:8762 ms1.0%
ClientMixin.sessiondjango/test/client.py:8122 ms1.0%
SessionStore.savedjango/contrib/sessions/backends/db.py:1212 ms1.0%
SuperuserTest.test_superusers_can_open_any_project_but_dont_list_themapps/orgs/tests.py:198 self.assertEqual(self.client.get(self.project.url("project_configure")).status_code, 200)6 ms2.5%
Client.getdjango/test/client.py:11246 ms2.5%
RequestFactory.getdjango/test/client.py:4756 ms2.5%
RequestFactory.genericdjango/test/client.py:6716 ms2.5%
Client.requestdjango/test/client.py:10826 ms2.5%
ClientHandler.__call__django/test/client.py:1866 ms2.5%
BaseHandler.get_responsedjango/core/handlers/base.py:1416 ms2.5%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:556 ms2.5%
DebugToolbarMiddleware.__call__debug_toolbar/middleware.py:1306 ms2.5%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:556 ms2.5%
MiddlewareMixin.__call__django/utils/deprecation.py:3096 ms2.5%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:556 ms2.5%
WhiteNoiseMiddleware.__call__whitenoise/middleware.py:1236 ms2.5%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:556 ms2.5%
MiddlewareMixin.__call__django/utils/deprecation.py:3096 ms2.5%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:556 ms2.5%
MiddlewareMixin.__call__django/utils/deprecation.py:3096 ms2.5%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:556 ms2.5%
MiddlewareMixin.__call__django/utils/deprecation.py:3095 ms2.0%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:555 ms2.0%
MiddlewareMixin.__call__django/utils/deprecation.py:3095 ms2.0%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:555 ms2.0%
MiddlewareMixin.__call__django/utils/deprecation.py:3095 ms2.0%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:555 ms2.0%
MiddlewareMixin.__call__django/utils/deprecation.py:3095 ms2.0%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:555 ms2.0%
AccountMiddleware.<locals>.middlewareallauth/account/middleware.py:345 ms2.0%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:555 ms2.0%
BaseHandler._get_responsedjango/core/handlers/base.py:1985 ms2.0%
user_passes_test.<locals>.decorator.<locals>._view_wrapperdjango/contrib/auth/decorators.py:595 ms2.0%
project_configureapps/projects/urls.py:534 return render(5 ms2.0%
renderdjango/shortcuts.py:255 ms2.0%
render_to_stringdjango/template/loader.py:625 ms2.0%
Template.renderdjango/template/backends/django.py:1075 ms2.0%
Template.renderdjango/template/base.py:1745 ms2.0%
instrumented_test_renderdjango/test/utils.py:1145 ms2.0%
NodeList.renderdjango/template/base.py:10915 ms2.0%
Node.render_annotateddjango/template/base.py:10525 ms2.0%
ExtendsNode.renderdjango/template/loader_tags.py:1605 ms2.0%
instrumented_test_renderdjango/test/utils.py:1145 ms2.0%
NodeList.renderdjango/template/base.py:10915 ms2.0%
Node.render_annotateddjango/template/base.py:10525 ms2.0%
ExtendsNode.renderdjango/template/loader_tags.py:1605 ms2.0%
instrumented_test_renderdjango/test/utils.py:1145 ms2.0%
NodeList.renderdjango/template/base.py:10915 ms2.0%
Node.render_annotateddjango/template/base.py:10525 ms2.0%
BlockNode.renderdjango/template/loader_tags.py:665 ms2.0%
NodeList.renderdjango/template/base.py:10915 ms2.0%
Node.render_annotateddjango/template/base.py:10525 ms2.0%
BlockNode.renderdjango/template/loader_tags.py:664 ms1.5%
NodeList.renderdjango/template/base.py:10914 ms1.5%
Node.render_annotateddjango/template/base.py:10524 ms1.5%
SimpleNode.renderdjango/template/library.py:3254 ms1.5%
heroicon_miniheroicons/templatetags/heroicons.py:184 ms1.5%
_render_iconheroicons/templatetags/heroicons.py:394 ms1.5%
_render_iconheroicons/__init__.py:454 ms1.5%
_load_iconheroicons/__init__.py:184 ms1.5%
ZipFile.__init__<stdlib>/zipfile/__init__.py:15054 ms1.5%
1 smaller frames hidden
1 smaller frames hidden
SuperuserTest.test_superusers_can_open_any_project_but_dont_list_themapps/orgs/tests.py:1955 ms2.0%
Estimated from 203 samples; phase durations are exact. Frames from pytest and pluggy are hidden .

Hot lines in your code

apps/orgs/tests.py:194
admin = User.objects.create_superuser("admin", "[email protected]", "pw")
SuperuserTest.test_superusers_can_open_any_project_but_dont_list_them · Password hashing
184 ms
ft/db/postgresql/base.py:39
return super().get_new_connection(conn_params)
DatabaseWrapper.get_new_connection · Database
8 ms
apps/orgs/tests.py:197
self.assertEqual(self.client.get(self.project.url()).status_code, 200)
SuperuserTest.test_superusers_can_open_any_project_but_dont_list_them · Libraries
7 ms
apps/orgs/tests.py:196
self.client.force_login(admin)
SuperuserTest.test_superusers_can_open_any_project_but_dont_list_them · Database
6 ms
apps/projects/urls.py:534
return render(
project_configure · Templates
5 ms
apps/orgs/models.py:46
while slug in reserved or taken.filter(slug=slug).exists():
unique_slug · Database
2 ms
apps/projects/urls.py:137
if not has_profiles and not Run.objects.filter(project=project).exists():
project_dashboard · Database
2 ms
apps/orgs/tests.py:199
response = self.client.get(reverse("projects"), follow=True)
SuperuserTest.test_superusers_can_open_any_project_but_dont_list_them · Libraries
2 ms
apps/projects/urls.py:138
return render(request, "project_setup.html", context)
project_dashboard · Templates
2 ms
apps/projects/testing.py:64
project = Project.objects.create(
make_project · Database
2 ms

Fixtures

Exact setup time
_unittest_setUpClass_fixture_SuperuserTest class 13 ms
_django_setup_unittest class 0.23 ms
_dj_autoclear_mailbox function 0.04 ms
_django_db_marker function 0.03 ms
_template_string_if_invalid_marker function 0.03 ms
_live_server_helper function 0.02 ms
_django_set_urlconf function 0.02 ms
_django_clear_site_cache function 0.02 ms
monkeypatch function 0.01 ms

Database

68 queries · 20 ms

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

5×
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 ?
4×
INSERT INTO "auth_user" ("password", "last_login", "is_superuser", "username", "first_name", "last_name", "email", "is_staff", "is_active", "date_joined") VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s) RETURNING "auth_user"."id"
4×
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_…
4×
SELECT "auth_user"."id", "auth_user"."password", "auth_user"."last_login", "auth_user"."is_superuser", "auth_user"."username", "auth_user"."first_name", "auth_user"."last_name", "auth_user"."email", "auth_user"."is_staff", "auth_user"."is_active", "auth_user"."date_joined" FROM "auth_user" WHERE "a…
3×
INSERT INTO "orgs_membership" ("organization_id", "user_id", "role", "date_created") VALUES (%s, %s, %s, %s) RETURNING "orgs_membership"."id"

Biggest pieces of work

call test body
apps/orgs/tests.py:194
224 ms
setup setUpClass
django/test/testcases.py:1423
13 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
10 hours ago CI github-actions:test passed 238 ms cb18ed3 main Profile
3 days, 20 hours ago CI github-actions:test passed 328 ms 9bd5864 main Profile
5 days, 20 hours ago CI github-actions:test passed 186 ms 19dac9b main Profile
6 days, 21 hours ago CI github-actions:test passed 509 ms e141198 main Profile
2 weeks, 4 days ago CI github-actions:test passed 187 ms 46ec2aa main Profile
3 weeks ago CI github-actions:test passed 322 ms afde85b main Profile
3 weeks ago CI github-actions:test passed 260 ms fe29f9d main Profile
3 weeks ago CI github-actions:test passed 326 ms 044719a main Profile
3 weeks, 1 day ago CI github-actions:test passed 211 ms b3fedae main Profile
3 weeks, 4 days ago CI github-actions:test passed 309 ms 43c4eda main Profile
3 weeks, 5 days ago CI github-actions:test passed 308 ms 9caa567 main Profile
3 weeks, 5 days ago CI github-actions:test passed 304 ms ec75501 main Profile
3 weeks, 6 days ago CI github-actions:test passed 341 ms d2c12e5 main Profile
3 weeks, 6 days ago CI github-actions:test passed 198 ms 0b902f6 main Profile
3 weeks, 6 days ago CI github-actions:test passed 373 ms 78a4357 main Profile