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

AccessTest::test_switchers

First seen 1 month, 1 week ago in 78a4357
CI github-actions:test 15 runs
Average
56 ms
median 63 ms
max 76 ms
Phases
Setup 0.64 ms Call 55 ms Teardown 0.95 ms
Categories
Database 36 ms Other (Libraries, Templates, Unsampled, pytest, ...) 20 ms

42 database queries per run

Needs 118 KB of memory (max 360 KB)

Duration per run

Where the time goes

Latest run in ci:github-actions:test, 2 weeks ago · open run
Show pytest frames
call46 ms97.9%
AccessTest.test_switchersapps/orgs/tests.py:82 response = self.client.get(self.project.url())26 ms56.0%
Client.getdjango/test/client.py:112426 ms56.0%
RequestFactory.getdjango/test/client.py:47526 ms56.0%
RequestFactory.genericdjango/test/client.py:67126 ms56.0%
Client.requestdjango/test/client.py:108226 ms56.0%
ClientHandler.__call__django/test/client.py:18615 ms32.6%
BaseHandler.get_responsedjango/core/handlers/base.py:14115 ms32.6%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5515 ms32.6%
DebugToolbarMiddleware.__call__debug_toolbar/middleware.py:13015 ms32.6%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5513 ms28.0%
MiddlewareMixin.__call__django/utils/deprecation.py:30913 ms28.0%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5513 ms28.0%
WhiteNoiseMiddleware.__call__whitenoise/middleware.py:12313 ms28.0%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5513 ms28.0%
MiddlewareMixin.__call__django/utils/deprecation.py:30913 ms28.0%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5513 ms28.0%
MiddlewareMixin.__call__django/utils/deprecation.py:30913 ms28.0%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5513 ms28.0%
MiddlewareMixin.__call__django/utils/deprecation.py:30911 ms23.3%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5511 ms23.3%
MiddlewareMixin.__call__django/utils/deprecation.py:30911 ms23.3%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5511 ms23.3%
MiddlewareMixin.__call__django/utils/deprecation.py:30911 ms23.3%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5511 ms23.3%
MiddlewareMixin.__call__django/utils/deprecation.py:30911 ms23.3%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5511 ms23.3%
AccountMiddleware.<locals>.middlewareallauth/account/middleware.py:3411 ms23.3%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5511 ms23.3%
BaseHandler._get_responsedjango/core/handlers/base.py:19811 ms23.3%
project_dashboardapps/projects/urls.py:1324 ms9.3%
find_projectapps/projects/urls.py:49 project = get_object_or_404(2 ms4.7%
get_object_or_404django/shortcuts.py:902 ms4.7%
QuerySet.getdjango/db/models/query.py:6352 ms4.7%
QuerySet.__len__django/db/models/query.py:3722 ms4.7%
QuerySet._fetch_alldjango/db/models/query.py:20002 ms4.7%
ModelIterable.__iter__django/db/models/query.py:952 ms4.7%
SQLCompiler.execute_sqldjango/db/models/sql/compiler.py:16112 ms4.7%
SQLCompiler.as_sqldjango/db/models/sql/compiler.py:7922 ms4.7%
SQLCompiler.get_from_clausedjango/db/models/sql/compiler.py:11592 ms4.7%
SQLCompiler.compiledjango/db/models/sql/compiler.py:5782 ms4.7%
Join.as_sqldjango/db/models/sql/datastructures.py:882 ms4.7%
DatabaseOperations.prepare_join_on_clausedjango/db/backends/postgresql/operations.py:3992 ms4.7%
find_projectapps/projects/urls.py:522 ms4.7%
can_viewapps/projects/urls.py:332 ms4.7%
can_manage_projectapps/projects/urls.py:40 return user.is_superuser or project.organization.membership_set.filter(user=user).exists()2 ms4.7%
QuerySet.existsdjango/db/models/query.py:13372 ms4.7%
Query.has_resultsdjango/db/models/sql/query.py:6812 ms4.7%
SQLCompiler.has_resultsdjango/db/models/sql/compiler.py:15922 ms4.7%
SQLCompiler.execute_sqldjango/db/models/sql/compiler.py:16242 ms4.7%
CursorWrapper.executedjango/db/backends/utils.py:792 ms4.7%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:922 ms4.7%
CursorWrapper._executedjango/db/backends/utils.py:1052 ms4.7%
Cursor.executepsycopg/cursor.py:1132 ms4.7%
Connection.waitpsycopg/connection.py:4952 ms4.7%
project_dashboardapps/projects/urls.py:1354 ms9.3%
shellapps/projects/urls.py:71 return org_shell(request, project.organization if project else None, section) | {2 ms4.7%
org_shellapps/orgs/views.py:422 ms4.7%
Organization.is_ownerapps/orgs/models.py:65 return user.is_authenticated and self.membership_set.filter(user=user, role=Membership.Role.OWNER).exists()2 ms4.7%
BaseManager._get_queryset_methods.<locals>.create_method.<locals>.manager_methoddjango/db/models/manager.py:872 ms4.7%
QuerySet.filterdjango/db/models/query.py:15422 ms4.7%
QuerySet._filter_or_excludedjango/db/models/query.py:15602 ms4.7%
QuerySet._filter_or_exclude_inplacedjango/db/models/query.py:15702 ms4.7%
Query.add_qdjango/db/models/sql/query.py:16712 ms4.7%
Query._add_qdjango/db/models/sql/query.py:17032 ms4.7%
Query.build_filterdjango/db/models/sql/query.py:16132 ms4.7%
Query.build_lookupdjango/db/models/sql/query.py:14402 ms4.7%
shellapps/projects/urls.py:732 ms4.7%
can_manageapps/projects/urls.py:442 ms4.7%
can_manage_projectapps/projects/urls.py:40 return user.is_superuser or project.organization.membership_set.filter(user=user).exists()2 ms4.7%
QuerySet.existsdjango/db/models/query.py:13372 ms4.7%
Query.has_resultsdjango/db/models/sql/query.py:6812 ms4.7%
SQLCompiler.has_resultsdjango/db/models/sql/compiler.py:15922 ms4.7%
SQLCompiler.execute_sqldjango/db/models/sql/compiler.py:16242 ms4.7%
CursorWrapper.executedjango/db/backends/utils.py:792 ms4.7%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:922 ms4.7%
CursorWrapper._executedjango/db/backends/utils.py:1052 ms4.7%
Cursor.executepsycopg/cursor.py:1132 ms4.7%
Connection.waitpsycopg/connection.py:4952 ms4.7%
project_dashboardapps/projects/urls.py:137 if not has_profiles and not Run.objects.filter(project=project).exists():2 ms4.7%
QuerySet.existsdjango/db/models/query.py:13372 ms4.7%
Query.has_resultsdjango/db/models/sql/query.py:6812 ms4.7%
SQLCompiler.has_resultsdjango/db/models/sql/compiler.py:15922 ms4.7%
SQLCompiler.execute_sqldjango/db/models/sql/compiler.py:16242 ms4.7%
CursorWrapper.executedjango/db/backends/utils.py:792 ms4.7%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:922 ms4.7%
CursorWrapper._executedjango/db/backends/utils.py:1052 ms4.7%
Cursor.executepsycopg/cursor.py:1132 ms4.7%
Connection.waitpsycopg/connection.py:4952 ms4.7%
ClientHandler.__call__django/test/client.py:1739 ms18.7%
BaseHandler.load_middlewaredjango/core/handlers/base.py:627 ms14.0%
WhiteNoiseMiddleware.__init__whitenoise/middleware.py:1047 ms14.0%
WhiteNoise.add_fileswhitenoise/base.py:1087 ms14.0%
WhiteNoise.update_files_dictionarywhitenoise/base.py:1207 ms14.0%
WhiteNoise.add_file_to_dictionarywhitenoise/base.py:1317 ms14.0%
WhiteNoise.get_static_filewhitenoise/base.py:2084 ms9.3%
StaticFile.__init__whitenoise/responders.py:722 ms4.7%
StaticFile.get_file_statswhitenoise/responders.py:1612 ms4.7%
__init____init__:-12 ms4.7%
FileEntry.__init__whitenoise/responders.py:2602 ms4.7%
<GC>~2 ms4.7%
StaticFile.__init__whitenoise/responders.py:762 ms4.7%
StaticFile.get_not_modified_responsewhitenoise/responders.py:1892 ms4.7%
Headers.__getitem__<stdlib>/wsgiref/headers.py:832 ms4.7%
Headers.get<stdlib>/wsgiref/headers.py:1042 ms4.7%
WhiteNoise.get_static_filewhitenoise/base.py:2032 ms4.7%
WhiteNoise.add_cache_headerswhitenoise/base.py:2242 ms4.7%
WhiteNoiseMiddleware.immutable_file_testwhitenoise/middleware.py:1762 ms4.7%
WhiteNoiseMiddleware.get_static_urlwhitenoise/middleware.py:1972 ms4.7%
URLMixin.urldebug_toolbar/panels/staticfiles.py:202 ms4.7%
HashedFilesMixin.urldjango/contrib/staticfiles/storage.py:2052 ms4.7%
HashedFilesMixin._urldjango/contrib/staticfiles/storage.py:1862 ms4.7%
FileSystemStorage.urldjango/core/files/storage/filesystem.py:2092 ms4.7%
BaseHandler.load_middlewaredjango/core/handlers/base.py:962 ms4.7%
convert_exception_to_responsedjango/core/handlers/exception.py:522 ms4.7%
update_wrapper<stdlib>/functools.py:582 ms4.7%
ClientHandler.__call__django/test/client.py:1762 ms4.7%
Signal.senddjango/dispatch/dispatcher.py:2092 ms4.7%
AccessTest.test_switchersapps/orgs/tests.py:81 self.client.force_login(self.member)11 ms23.3%
ClientMixin.force_logindjango/test/client.py:85511 ms23.3%
ClientMixin._logindjango/test/client.py:8817 ms14.0%
logindjango/contrib/auth/__init__.py:1874 ms9.3%
SessionBase.cycle_keydjango/contrib/sessions/backends/base.py:4342 ms4.7%
SessionStore.createdjango/contrib/sessions/backends/db.py:742 ms4.7%
SessionStore.savedjango/contrib/sessions/backends/db.py:1262 ms4.7%
Atomic.__enter__django/db/transaction.py:2112 ms4.7%
async_unsafe.<locals>.decorator.<locals>.innerdjango/utils/asyncio.py:262 ms4.7%
BaseDatabaseWrapper.savepointdjango/db/backends/base/base.py:4002 ms4.7%
BaseDatabaseWrapper._savepointdjango/db/backends/base/base.py:3672 ms4.7%
CursorWrapper.executedjango/db/backends/utils.py:792 ms4.7%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:922 ms4.7%
CursorWrapper._executedjango/db/backends/utils.py:1032 ms4.7%
Cursor.executepsycopg/cursor.py:1132 ms4.7%
Connection.waitpsycopg/connection.py:4952 ms4.7%
SessionBase.cycle_keydjango/contrib/sessions/backends/base.py:4372 ms4.7%
SessionStore.deletedjango/contrib/sessions/backends/db.py:1752 ms4.7%
Model.deletedjango/db/models/base.py:12972 ms4.7%
Collector.collectdjango/db/models/deletion.py:2822 ms4.7%
logindjango/contrib/auth/__init__.py:1752 ms4.7%
SessionBase.__contains__django/contrib/sessions/backends/base.py:522 ms4.7%
SessionBase._get_sessiondjango/contrib/sessions/backends/base.py:2512 ms4.7%
SessionStore.loaddjango/contrib/sessions/backends/db.py:552 ms4.7%
SessionStore._get_session_from_dbdjango/contrib/sessions/backends/db.py:342 ms4.7%
BaseManager._get_queryset_methods.<locals>.create_method.<locals>.manager_methoddjango/db/models/manager.py:872 ms4.7%
QuerySet.getdjango/db/models/query.py:6352 ms4.7%
QuerySet.__len__django/db/models/query.py:3722 ms4.7%
QuerySet._fetch_alldjango/db/models/query.py:20002 ms4.7%
ModelIterable.__iter__django/db/models/query.py:952 ms4.7%
SQLCompiler.execute_sqldjango/db/models/sql/compiler.py:16242 ms4.7%
CursorWrapper.executedjango/db/backends/utils.py:792 ms4.7%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:922 ms4.7%
CursorWrapper._executedjango/db/backends/utils.py:1052 ms4.7%
Cursor.executepsycopg/cursor.py:1132 ms4.7%
Connection.waitpsycopg/connection.py:4952 ms4.7%
ClientMixin._logindjango/test/client.py:8762 ms4.7%
ClientMixin.sessiondjango/test/client.py:8122 ms4.7%
SessionStore.savedjango/contrib/sessions/backends/db.py:1212 ms4.7%
SessionStore.createdjango/contrib/sessions/backends/db.py:742 ms4.7%
SessionStore.savedjango/contrib/sessions/backends/db.py:1262 ms4.7%
Atomic.__enter__django/db/transaction.py:2112 ms4.7%
async_unsafe.<locals>.decorator.<locals>.innerdjango/utils/asyncio.py:262 ms4.7%
BaseDatabaseWrapper.savepointdjango/db/backends/base/base.py:4002 ms4.7%
BaseDatabaseWrapper._savepointdjango/db/backends/base/base.py:3672 ms4.7%
CursorWrapper.executedjango/db/backends/utils.py:792 ms4.7%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:922 ms4.7%
CursorWrapper._executedjango/db/backends/utils.py:1032 ms4.7%
Cursor.executepsycopg/cursor.py:1132 ms4.7%
Connection.waitpsycopg/connection.py:4952 ms4.7%
ClientMixin._logindjango/test/client.py:8832 ms4.7%
SessionStore.savedjango/contrib/sessions/backends/db.py:1232 ms4.7%
SessionStore.create_model_instancedjango/contrib/sessions/backends/db.py:1022 ms4.7%
SessionBase.encodedjango/contrib/sessions/backends/base.py:1262 ms4.7%
dumpsdjango/core/signing.py:1512 ms4.7%
Signer.sign_objectdjango/core/signing.py:2262 ms4.7%
JSONSerializer.dumpsdjango/core/signing.py:1262 ms4.7%
dumps<stdlib>/json/__init__.py:2412 ms4.7%
AccessTest.test_switchersapps/orgs/tests.py:80 other = make_project("Docs site", members=[self.member])7 ms14.0%
make_projectapps/projects/testing.py:622 ms4.7%
unique_slugapps/orgs/models.py:46 while slug in reserved or taken.filter(slug=slug).exists():2 ms4.7%
QuerySet.existsdjango/db/models/query.py:13372 ms4.7%
Query.has_resultsdjango/db/models/sql/query.py:6812 ms4.7%
SQLCompiler.has_resultsdjango/db/models/sql/compiler.py:15922 ms4.7%
SQLCompiler.execute_sqldjango/db/models/sql/compiler.py:16242 ms4.7%
CursorWrapper.executedjango/db/backends/utils.py:792 ms4.7%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:922 ms4.7%
CursorWrapper._executedjango/db/backends/utils.py:1052 ms4.7%
Cursor.executepsycopg/cursor.py:1132 ms4.7%
Connection.waitpsycopg/connection.py:4952 ms4.7%
make_projectapps/projects/testing.py:672 ms4.7%
unique_slugapps/orgs/models.py:46 while slug in reserved or taken.filter(slug=slug).exists():2 ms4.7%
QuerySet.existsdjango/db/models/query.py:13372 ms4.7%
Query.has_resultsdjango/db/models/sql/query.py:6812 ms4.7%
SQLCompiler.has_resultsdjango/db/models/sql/compiler.py:15922 ms4.7%
SQLCompiler.execute_sqldjango/db/models/sql/compiler.py:16242 ms4.7%
CursorWrapper.executedjango/db/backends/utils.py:792 ms4.7%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:922 ms4.7%
CursorWrapper._executedjango/db/backends/utils.py:1052 ms4.7%
Cursor.executepsycopg/cursor.py:1132 ms4.7%
Connection.waitpsycopg/connection.py:4952 ms4.7%
BaseCursor._execute_genpsycopg/_cursor_base.py:2052 ms4.7%
BaseCursor._convert_querypsycopg/_cursor_base.py:4652 ms4.7%
make_projectapps/projects/testing.py:712 ms4.7%
add_memberapps/projects/testing.py:76 membership, _ = Membership.objects.get_or_create(2 ms4.7%
BaseManager._get_queryset_methods.<locals>.create_method.<locals>.manager_methoddjango/db/models/manager.py:872 ms4.7%
QuerySet.get_or_createdjango/db/models/query.py:9942 ms4.7%
QuerySet.createdjango/db/models/query.py:6692 ms4.7%
Model.savedjango/db/models/base.py:8742 ms4.7%
Model.save_basedjango/db/models/base.py:9662 ms4.7%
Model._save_tabledjango/db/models/base.py:11672 ms4.7%
Model._do_insertdjango/db/models/base.py:12182 ms4.7%
BaseManager._get_queryset_methods.<locals>.create_method.<locals>.manager_methoddjango/db/models/manager.py:872 ms4.7%
QuerySet._insertdjango/db/models/query.py:19182 ms4.7%
SQLInsertCompiler.execute_sqldjango/db/models/sql/compiler.py:19252 ms4.7%
CursorWrapper.executedjango/db/backends/utils.py:792 ms4.7%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:922 ms4.7%
CursorWrapper._executedjango/db/backends/utils.py:1052 ms4.7%
Cursor.executepsycopg/cursor.py:1132 ms4.7%
Connection.waitpsycopg/connection.py:4952 ms4.7%
TransactionTestCase._post_teardowndjango/test/testcases.py:1240 self._fixture_teardown()2 ms4.7%
TestCase._fixture_teardowndjango/test/testcases.py:14972 ms4.7%
TestCase._rollback_atomicsdjango/test/testcases.py:14052 ms4.7%
Atomic.__exit__django/db/transaction.py:2832 ms4.7%
async_unsafe.<locals>.decorator.<locals>.innerdjango/utils/asyncio.py:262 ms4.7%
BaseDatabaseWrapper.savepoint_rollbackdjango/db/backends/base/base.py:4132 ms4.7%
BaseDatabaseWrapper._savepoint_rollbackdjango/db/backends/base/base.py:3712 ms4.7%
CursorWrapper.executedjango/db/backends/utils.py:792 ms4.7%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:922 ms4.7%
CursorWrapper._executedjango/db/backends/utils.py:1032 ms4.7%
Cursor.executepsycopg/cursor.py:1132 ms4.7%
Connection.waitpsycopg/connection.py:4952 ms4.7%
Estimated from 21 samples; phase durations are exact. Frames from pytest and pluggy are hidden .

Hot lines in your code

apps/orgs/tests.py:82
response = self.client.get(self.project.url())
AccessTest.test_switchers · Libraries
15 ms
apps/orgs/tests.py:81
self.client.force_login(self.member)
AccessTest.test_switchers · Database
11 ms
apps/orgs/models.py:46
while slug in reserved or taken.filter(slug=slug).exists():
unique_slug · Database
4 ms
apps/projects/urls.py:40
return user.is_superuser or project.organization.membership_set.filter(user=user).exists()
can_manage_project · Database
4 ms
apps/projects/testing.py:76
membership, _ = Membership.objects.get_or_create(
add_member · Database
2 ms
apps/projects/urls.py:49
project = get_object_or_404(
find_project · Database
2 ms
apps/orgs/models.py:65
return user.is_authenticated and self.membership_set.filter(user=user, role=Membership.Role.OWNER).exists()
Organization.is_owner · 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

Fixtures

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

Database

42 queries · 8 ms
No repeated queries.

Biggest pieces of work

call test body
apps/orgs/tests.py:80
44 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 47 ms cb18ed3 main Profile
2 weeks, 4 days ago CI github-actions:test passed 63 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 76 ms e141198 main Profile
1 month ago CI github-actions:test passed 34 ms 46ec2aa main Profile
1 month ago CI github-actions:test passed 57 ms afde85b main Profile
1 month ago CI github-actions:test passed 53 ms fe29f9d main Profile
1 month ago CI github-actions:test passed 74 ms 044719a main Profile
1 month ago CI github-actions:test passed 38 ms b3fedae main Profile
1 month, 1 week ago CI github-actions:test passed 65 ms 43c4eda main Profile
1 month, 1 week ago CI github-actions:test passed 63 ms 9caa567 main Profile
1 month, 1 week ago CI github-actions:test passed 66 ms ec75501 main Profile
1 month, 1 week ago CI github-actions:test passed 75 ms d2c12e5 main Profile
1 month, 1 week ago CI github-actions:test passed 38 ms 0b902f6 main Profile
1 month, 1 week ago CI github-actions:test passed 64 ms 78a4357 main Profile