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

ProjectCreatePage::test_invalid_form

First seen 2 years, 10 months ago in b9e98d9
CI github-actions:test 12 runs
Average
57 ms
median 62 ms
max 80 ms
Phases
Setup 0.68 ms Call 56 ms Teardown 0.17 ms
Categories
Database 33 ms App code 0.16 ms Other (Libraries, Templates, Unsampled, pytest) 24 ms

40 database queries per run

Needs 102 KB of memory (max 776 KB)

Duration per run

Where the time goes

Latest run in ci:github-actions:test, 16 hours ago · open run
Show pytest frames
setup0.79 ms1.4%
call57 ms98.3%
ProjectCreatePage.test_invalid_formapps/projects/tests.py:254 self.client.get("/projects/create/")22 ms38.5%
Client.getdjango/test/client.py:112422 ms38.5%
RequestFactory.getdjango/test/client.py:47522 ms38.5%
RequestFactory.genericdjango/test/client.py:67122 ms38.5%
Client.requestdjango/test/client.py:108222 ms38.5%
ClientHandler.__call__django/test/client.py:17322 ms38.5%
BaseHandler.load_middlewaredjango/core/handlers/base.py:6222 ms38.5%
WhiteNoiseMiddleware.__init__whitenoise/middleware.py:10422 ms38.5%
WhiteNoise.add_fileswhitenoise/base.py:10822 ms38.5%
WhiteNoise.update_files_dictionarywhitenoise/base.py:12015 ms25.6%
WhiteNoise.add_file_to_dictionarywhitenoise/base.py:13112 ms21.4%
WhiteNoise.get_static_filewhitenoise/base.py:20810 ms17.1%
StaticFile.__init__whitenoise/responders.py:742 ms4.3%
parsedate<stdlib>/email/_parseaddr.py:1852 ms4.3%
StaticFile.__init__whitenoise/responders.py:732 ms4.3%
StaticFile.get_headerswhitenoise/responders.py:1762 ms4.3%
formatdate<stdlib>/email/utils.py:2662 ms4.3%
StaticFile.__init__whitenoise/responders.py:762 ms4.3%
StaticFile.get_not_modified_responsewhitenoise/responders.py:1882 ms4.3%
WhiteNoise.update_files_dictionarywhitenoise/base.py:1157 ms12.8%
scantreewhitenoise/base.py:2627 ms12.8%
scantreewhitenoise/base.py:2622 ms4.3%
scantreewhitenoise/base.py:2622 ms4.3%
scantreewhitenoise/base.py:2622 ms4.3%
scantreewhitenoise/base.py:2622 ms4.3%
scantreewhitenoise/base.py:2642 ms4.3%
ProjectCreatePage.test_invalid_formapps/projects/tests.py:256 response = self.client.post(reverse("project_create", args=[organization.slug]), {"name": ""})17 ms29.9%
Client.postdjango/test/client.py:115317 ms29.9%
RequestFactory.postdjango/test/client.py:49917 ms29.9%
RequestFactory.genericdjango/test/client.py:67117 ms29.9%
Client.requestdjango/test/client.py:108217 ms29.9%
ClientHandler.__call__django/test/client.py:18617 ms29.9%
BaseHandler.get_responsedjango/core/handlers/base.py:14117 ms29.9%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5517 ms29.9%
DebugToolbarMiddleware.__call__debug_toolbar/middleware.py:13017 ms29.9%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5517 ms29.9%
MiddlewareMixin.__call__django/utils/deprecation.py:30917 ms29.9%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5517 ms29.9%
WhiteNoiseMiddleware.__call__whitenoise/middleware.py:12317 ms29.9%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5517 ms29.9%
MiddlewareMixin.__call__django/utils/deprecation.py:30915 ms25.6%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5515 ms25.6%
MiddlewareMixin.__call__django/utils/deprecation.py:30915 ms25.6%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5515 ms25.6%
MiddlewareMixin.__call__django/utils/deprecation.py:30915 ms25.6%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5515 ms25.6%
MiddlewareMixin.__call__django/utils/deprecation.py:30915 ms25.6%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5515 ms25.6%
MiddlewareMixin.__call__django/utils/deprecation.py:30915 ms25.6%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5515 ms25.6%
MiddlewareMixin.__call__django/utils/deprecation.py:30915 ms25.6%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5515 ms25.6%
AccountMiddleware.<locals>.middlewareallauth/account/middleware.py:3415 ms25.6%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5515 ms25.6%
BaseHandler._get_responsedjango/core/handlers/base.py:19815 ms25.6%
user_passes_test.<locals>.decorator.<locals>._view_wrapperdjango/contrib/auth/decorators.py:5912 ms21.4%
project_createapps/orgs/views.py:126 first = not Project.objects.filter(organization__membership__user=request.user).exists()5 ms8.5%
BaseManager._get_queryset_methods.<locals>.create_method.<locals>.manager_methoddjango/db/models/manager.py:872 ms4.3%
QuerySet.existsdjango/db/models/query.py:13372 ms4.3%
Query.has_resultsdjango/db/models/sql/query.py:6812 ms4.3%
SQLCompiler.has_resultsdjango/db/models/sql/compiler.py:15922 ms4.3%
SQLCompiler.execute_sqldjango/db/models/sql/compiler.py:16242 ms4.3%
CursorWrapper.executedjango/db/backends/utils.py:792 ms4.3%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:922 ms4.3%
CursorWrapper._executedjango/db/backends/utils.py:1052 ms4.3%
Cursor.executepsycopg/cursor.py:1132 ms4.3%
Connection.waitpsycopg/connection.py:4952 ms4.3%
BaseCursor._execute_genpsycopg/_cursor_base.py:2062 ms4.3%
BaseCursor._maybe_prepare_genpsycopg/_cursor_base.py:2862 ms4.3%
ClientCursorMixin._execute_sendpsycopg/client_cursor.py:782 ms4.3%
project_createapps/orgs/views.py:1252 ms4.3%
member_organizationapps/orgs/views.py:59 organization = get_object_or_404(Organization, slug=org_slug)2 ms4.3%
get_object_or_404django/shortcuts.py:902 ms4.3%
QuerySet.getdjango/db/models/query.py:6352 ms4.3%
QuerySet.__len__django/db/models/query.py:3722 ms4.3%
QuerySet._fetch_alldjango/db/models/query.py:20002 ms4.3%
ModelIterable.__iter__django/db/models/query.py:952 ms4.3%
SQLCompiler.execute_sqldjango/db/models/sql/compiler.py:16622 ms4.3%
cursor_iterdjango/db/models/sql/compiler.py:22542 ms4.3%
cursor_iter.<locals>.<lambda>django/db/models/sql/compiler.py:22542 ms4.3%
DatabaseErrorWrapper.__call__.<locals>.innerdjango/db/utils.py:1012 ms4.3%
Cursor.fetchmanypsycopg/cursor.py:2682 ms4.3%
project_createapps/orgs/views.py:1272 ms4.3%
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.3%
QuerySet.existsdjango/db/models/query.py:13372 ms4.3%
Query.has_resultsdjango/db/models/sql/query.py:6812 ms4.3%
SQLCompiler.has_resultsdjango/db/models/sql/compiler.py:15922 ms4.3%
SQLCompiler.execute_sqldjango/db/models/sql/compiler.py:16242 ms4.3%
CursorWrapper.executedjango/db/backends/utils.py:792 ms4.3%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:922 ms4.3%
CursorWrapper._executedjango/db/backends/utils.py:1052 ms4.3%
Cursor.executepsycopg/cursor.py:1132 ms4.3%
Connection.waitpsycopg/connection.py:4952 ms4.3%
BaseCursor._execute_genpsycopg/_cursor_base.py:2062 ms4.3%
BaseCursor._maybe_prepare_genpsycopg/_cursor_base.py:2862 ms4.3%
ClientCursorMixin._execute_sendpsycopg/client_cursor.py:782 ms4.3%
project_createapps/orgs/views.py:1412 ms4.3%
org_shellapps/orgs/views.py:422 ms4.3%
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.3%
QuerySet.existsdjango/db/models/query.py:13372 ms4.3%
Query.has_resultsdjango/db/models/sql/query.py:6792 ms4.3%
Query.existsdjango/db/models/sql/query.py:6752 ms4.3%
Query.add_annotationdjango/db/models/sql/query.py:12422 ms4.3%
user_passes_test.<locals>.decorator.<locals>._view_wrapperdjango/contrib/auth/decorators.py:562 ms4.3%
login_required.<locals>.<lambda>django/contrib/auth/decorators.py:792 ms4.3%
new_method_proxy.<locals>.innerdjango/utils/functional.py:2512 ms4.3%
SimpleLazyObject._setupdjango/utils/functional.py:4042 ms4.3%
AuthenticationMiddleware.process_request.<locals>.<lambda>django/contrib/auth/middleware.py:402 ms4.3%
get_userdjango/contrib/auth/middleware.py:202 ms4.3%
get_userdjango/contrib/auth/__init__.py:3182 ms4.3%
ModelBackend.get_userdjango/contrib/auth/backends.py:2322 ms4.3%
BaseManager._get_queryset_methods.<locals>.create_method.<locals>.manager_methoddjango/db/models/manager.py:872 ms4.3%
QuerySet.getdjango/db/models/query.py:6352 ms4.3%
QuerySet.__len__django/db/models/query.py:3722 ms4.3%
QuerySet._fetch_alldjango/db/models/query.py:20002 ms4.3%
ModelIterable.__iter__django/db/models/query.py:952 ms4.3%
SQLCompiler.execute_sqldjango/db/models/sql/compiler.py:16242 ms4.3%
CursorWrapper.executedjango/db/backends/utils.py:792 ms4.3%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:922 ms4.3%
CursorWrapper._executedjango/db/backends/utils.py:1052 ms4.3%
Cursor.executepsycopg/cursor.py:1132 ms4.3%
Connection.waitpsycopg/connection.py:4952 ms4.3%
BaseCursor._execute_genpsycopg/_cursor_base.py:2062 ms4.3%
BaseCursor._maybe_prepare_genpsycopg/_cursor_base.py:2862 ms4.3%
ClientCursorMixin._execute_sendpsycopg/client_cursor.py:782 ms4.3%
MiddlewareMixin.__call__django/utils/deprecation.py:3112 ms4.3%
SessionMiddleware.process_responsedjango/contrib/sessions/middleware.py:592 ms4.3%
SessionStore.savedjango/contrib/sessions/backends/db.py:1272 ms4.3%
Model.savedjango/db/models/base.py:8742 ms4.3%
Model.save_basedjango/db/models/base.py:9662 ms4.3%
Model._save_tabledjango/db/models/base.py:11102 ms4.3%
Model._do_updatedjango/db/models/base.py:12112 ms4.3%
QuerySet._updatedjango/db/models/query.py:13272 ms4.3%
SQLUpdateCompiler.execute_returning_sqldjango/db/models/sql/compiler.py:21402 ms4.3%
SQLUpdateCompiler.execute_sqldjango/db/models/sql/compiler.py:21112 ms4.3%
SQLCompiler.execute_sqldjango/db/models/sql/compiler.py:16112 ms4.3%
SQLUpdateCompiler.as_sqldjango/db/models/sql/compiler.py:20882 ms4.3%
SQLCompiler.compiledjango/db/models/sql/compiler.py:5782 ms4.3%
WhereNode.as_sqldjango/db/models/sql/where.py:1512 ms4.3%
ProjectCreatePage.setUpapps/projects/tests.py:219 self.client.force_login(self.user)10 ms17.1%
ClientMixin.force_logindjango/test/client.py:85510 ms17.1%
ClientMixin._logindjango/test/client.py:8815 ms8.5%
logindjango/contrib/auth/__init__.py:1752 ms4.3%
SessionBase.__contains__django/contrib/sessions/backends/base.py:522 ms4.3%
SessionBase._get_sessiondjango/contrib/sessions/backends/base.py:2512 ms4.3%
SessionStore.loaddjango/contrib/sessions/backends/db.py:552 ms4.3%
SessionStore._get_session_from_dbdjango/contrib/sessions/backends/db.py:342 ms4.3%
BaseManager._get_queryset_methods.<locals>.create_method.<locals>.manager_methoddjango/db/models/manager.py:872 ms4.3%
QuerySet.getdjango/db/models/query.py:6352 ms4.3%
QuerySet.__len__django/db/models/query.py:3722 ms4.3%
QuerySet._fetch_alldjango/db/models/query.py:20002 ms4.3%
ModelIterable.__iter__django/db/models/query.py:952 ms4.3%
SQLCompiler.execute_sqldjango/db/models/sql/compiler.py:16242 ms4.3%
CursorWrapper.executedjango/db/backends/utils.py:792 ms4.3%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:922 ms4.3%
CursorWrapper._executedjango/db/backends/utils.py:1052 ms4.3%
Cursor.executepsycopg/cursor.py:1132 ms4.3%
Connection.waitpsycopg/connection.py:4952 ms4.3%
logindjango/contrib/auth/__init__.py:1872 ms4.3%
SessionBase.cycle_keydjango/contrib/sessions/backends/base.py:4342 ms4.3%
SessionStore.createdjango/contrib/sessions/backends/db.py:742 ms4.3%
SessionStore.savedjango/contrib/sessions/backends/db.py:1262 ms4.3%
Atomic.__enter__django/db/transaction.py:2112 ms4.3%
async_unsafe.<locals>.decorator.<locals>.innerdjango/utils/asyncio.py:262 ms4.3%
BaseDatabaseWrapper.savepointdjango/db/backends/base/base.py:4002 ms4.3%
BaseDatabaseWrapper._savepointdjango/db/backends/base/base.py:3672 ms4.3%
ClientMixin._logindjango/test/client.py:8762 ms4.3%
ClientMixin.sessiondjango/test/client.py:8122 ms4.3%
SessionStore.savedjango/contrib/sessions/backends/db.py:1212 ms4.3%
SessionStore.createdjango/contrib/sessions/backends/db.py:702 ms4.3%
SessionBase._get_new_session_keydjango/contrib/sessions/backends/base.py:1982 ms4.3%
SessionStore.existsdjango/contrib/sessions/backends/db.py:632 ms4.3%
ClientMixin._logindjango/test/client.py:8832 ms4.3%
SessionStore.savedjango/contrib/sessions/backends/db.py:1272 ms4.3%
Model.savedjango/db/models/base.py:8742 ms4.3%
Model.save_basedjango/db/models/base.py:9662 ms4.3%
Model._save_tabledjango/db/models/base.py:11102 ms4.3%
Model._do_updatedjango/db/models/base.py:12112 ms4.3%
QuerySet._updatedjango/db/models/query.py:13272 ms4.3%
SQLUpdateCompiler.execute_returning_sqldjango/db/models/sql/compiler.py:21402 ms4.3%
SQLUpdateCompiler.execute_sqldjango/db/models/sql/compiler.py:21112 ms4.3%
SQLCompiler.execute_sqldjango/db/models/sql/compiler.py:16242 ms4.3%
CursorWrapper.executedjango/db/backends/utils.py:792 ms4.3%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:922 ms4.3%
CursorWrapper._executedjango/db/backends/utils.py:1052 ms4.3%
Cursor.executepsycopg/cursor.py:1132 ms4.3%
Connection.waitpsycopg/connection.py:4952 ms4.3%
TransactionTestCase._post_teardowndjango/test/testcases.py:1240 self._fixture_teardown()5 ms8.5%
TestCase._fixture_teardowndjango/test/testcases.py:14942 ms4.3%
TestCase._should_check_constraintsdjango/test/testcases.py:15032 ms4.3%
DatabaseWrapper.is_usabledjango/db/backends/postgresql/base.py:4922 ms4.3%
Cursor.executepsycopg/cursor.py:1132 ms4.3%
Connection.waitpsycopg/connection.py:4952 ms4.3%
BaseCursor._execute_genpsycopg/_cursor_base.py:2062 ms4.3%
BaseCursor._maybe_prepare_genpsycopg/_cursor_base.py:2862 ms4.3%
ClientCursorMixin._execute_sendpsycopg/client_cursor.py:782 ms4.3%
TestCase._fixture_teardowndjango/test/testcases.py:14972 ms4.3%
TestCase._rollback_atomicsdjango/test/testcases.py:14052 ms4.3%
Atomic.__exit__django/db/transaction.py:2862 ms4.3%
async_unsafe.<locals>.decorator.<locals>.innerdjango/utils/asyncio.py:262 ms4.3%
BaseDatabaseWrapper.savepoint_commitdjango/db/backends/base/base.py:4312 ms4.3%
BaseDatabaseWrapper._savepoint_commitdjango/db/backends/base/base.py:3752 ms4.3%
CursorWrapper.executedjango/db/backends/utils.py:792 ms4.3%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:922 ms4.3%
CursorWrapper._executedjango/db/backends/utils.py:1032 ms4.3%
Cursor.executepsycopg/cursor.py:1132 ms4.3%
Connection.waitpsycopg/connection.py:4952 ms4.3%
BaseCursor._execute_genpsycopg/_cursor_base.py:2062 ms4.3%
BaseCursor._maybe_prepare_genpsycopg/_cursor_base.py:2862 ms4.3%
ClientCursorMixin._execute_sendpsycopg/client_cursor.py:782 ms4.3%
ProjectCreatePage.test_invalid_formapps/projects/tests.py:255 organization = Membership.objects.get(user=self.user).organization2 ms4.3%
ForwardManyToOneDescriptor.__get__django/db/models/fields/related_descriptors.py:2572 ms4.3%
ForwardManyToOneDescriptor.get_objectdjango/db/models/fields/related_descriptors.py:2222 ms4.3%
QuerySet.getdjango/db/models/query.py:6352 ms4.3%
QuerySet.__len__django/db/models/query.py:3722 ms4.3%
QuerySet._fetch_alldjango/db/models/query.py:20002 ms4.3%
ModelIterable.__iter__django/db/models/query.py:952 ms4.3%
SQLCompiler.execute_sqldjango/db/models/sql/compiler.py:16242 ms4.3%
CursorWrapper.executedjango/db/backends/utils.py:792 ms4.3%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:922 ms4.3%
CursorWrapper._executedjango/db/backends/utils.py:1052 ms4.3%
Cursor.executepsycopg/cursor.py:1132 ms4.3%
Connection.waitpsycopg/connection.py:4952 ms4.3%
BaseCursor._execute_genpsycopg/_cursor_base.py:2062 ms4.3%
BaseCursor._maybe_prepare_genpsycopg/_cursor_base.py:2862 ms4.3%
ClientCursorMixin._execute_sendpsycopg/client_cursor.py:782 ms4.3%
Estimated from 24 samples; phase durations are exact. Frames from pytest and pluggy are hidden .

Hot lines in your code

apps/projects/tests.py:254
self.client.get("/projects/create/")
ProjectCreatePage.test_invalid_form · Libraries
22 ms
apps/projects/tests.py:219
self.client.force_login(self.user)
ProjectCreatePage.setUp · Database
10 ms
apps/projects/tests.py:256
response = self.client.post(reverse("project_create", args=[organization.slug]), {"name": ""})
ProjectCreatePage.test_invalid_form · Database
5 ms
apps/orgs/views.py:126
first = not Project.objects.filter(organization__membership__user=request.user).exists()
project_create · Database
5 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
5 ms
apps/projects/tests.py:255
organization = Membership.objects.get(user=self.user).organization
ProjectCreatePage.test_invalid_form · Database
2 ms
apps/orgs/views.py:59
organization = get_object_or_404(Organization, slug=org_slug)
member_organization · Database
2 ms

Fixtures

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

Database

40 queries · 11 ms

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

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:254
42 ms
call setUp
apps/projects/tests.py:219
10 ms
call _post_teardown
django/test/testcases.py:1240
5 ms
setup pytest internals 0.79 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 58 ms e141198 main Profile
1 week, 5 days ago CI github-actions:test passed 31 ms 46ec2aa main Profile
2 weeks, 1 day ago CI github-actions:test passed 64 ms afde85b main Profile
2 weeks, 1 day ago CI github-actions:test passed 51 ms fe29f9d main Profile
2 weeks, 1 day ago CI github-actions:test passed 80 ms 044719a main Profile
2 weeks, 2 days ago CI github-actions:test passed 41 ms b3fedae main Profile
2 weeks, 4 days ago CI github-actions:test passed 65 ms 43c4eda main Profile
2 weeks, 6 days ago CI github-actions:test passed 64 ms 9caa567 main Profile
2 weeks, 6 days ago CI github-actions:test passed 62 ms ec75501 main Profile
3 weeks ago CI github-actions:test passed 75 ms d2c12e5 main Profile
3 weeks ago CI github-actions:test passed 33 ms 0b902f6 main Profile
3 weeks ago CI github-actions:test passed 62 ms 78a4357 main Profile