flakytest.dev anze3db flakytest
Tests / ft/tests.py

TestProjectsHome::test_user_logged_in_with_multiple_projects

First seen 1 month, 1 week ago in 78a4357
CI github-actions:test 15 runs
Average
50 ms
median 56 ms
max 78 ms
Phases
Setup 0.68 ms Call 50 ms Teardown 0.15 ms
Categories
Database 28 ms Password hashing 0.14 ms Other (Libraries, pytest, Unsampled) 23 ms

37 database queries per run

Needs 39 KB of memory (max 432 KB)

Duration per run

Where the time goes

Latest run in ci:github-actions:test, 2 weeks ago · open run
Show pytest frames
call41 ms98.4%
TestProjectsHome.test_user_logged_in_with_multiple_projectsft/tests.py:58 response = self.client.get(reverse("projects"))18 ms43.0%
Client.getdjango/test/client.py:112418 ms43.0%
RequestFactory.getdjango/test/client.py:47518 ms43.0%
RequestFactory.genericdjango/test/client.py:67118 ms43.0%
Client.requestdjango/test/client.py:108218 ms43.0%
ClientHandler.__call__django/test/client.py:17316 ms36.9%
BaseHandler.load_middlewaredjango/core/handlers/base.py:6216 ms36.9%
WhiteNoiseMiddleware.__init__whitenoise/middleware.py:10416 ms36.9%
WhiteNoise.add_fileswhitenoise/base.py:10816 ms36.9%
WhiteNoise.update_files_dictionarywhitenoise/base.py:12013 ms30.7%
WhiteNoise.add_file_to_dictionarywhitenoise/base.py:13113 ms30.7%
WhiteNoise.get_static_filewhitenoise/base.py:20813 ms30.7%
StaticFile.__init__whitenoise/responders.py:735 ms12.3%
StaticFile.get_headerswhitenoise/responders.py:1813 ms6.1%
StaticFile.get_headerswhitenoise/responders.py:1703 ms6.1%
StaticFile.__init__whitenoise/responders.py:763 ms6.1%
StaticFile.get_not_modified_responsewhitenoise/responders.py:1883 ms6.1%
StaticFile.__init__whitenoise/responders.py:773 ms6.1%
StaticFile.get_alternativeswhitenoise/responders.py:2003 ms6.1%
StaticFile.__init__whitenoise/responders.py:753 ms6.1%
Headers.__getitem__<stdlib>/wsgiref/headers.py:833 ms6.1%
Headers.get<stdlib>/wsgiref/headers.py:1063 ms6.1%
WhiteNoise.update_files_dictionarywhitenoise/base.py:1153 ms6.1%
scantreewhitenoise/base.py:2623 ms6.1%
scantreewhitenoise/base.py:2623 ms6.1%
scantreewhitenoise/base.py:2643 ms6.1%
ClientHandler.__call__django/test/client.py:1863 ms6.1%
BaseHandler.get_responsedjango/core/handlers/base.py:1413 ms6.1%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:553 ms6.1%
DebugToolbarMiddleware.__call__debug_toolbar/middleware.py:1303 ms6.1%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:553 ms6.1%
MiddlewareMixin.__call__django/utils/deprecation.py:3093 ms6.1%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:553 ms6.1%
WhiteNoiseMiddleware.__call__whitenoise/middleware.py:1233 ms6.1%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:553 ms6.1%
MiddlewareMixin.__call__django/utils/deprecation.py:3093 ms6.1%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:553 ms6.1%
MiddlewareMixin.__call__django/utils/deprecation.py:3093 ms6.1%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:553 ms6.1%
MiddlewareMixin.__call__django/utils/deprecation.py:3093 ms6.1%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:553 ms6.1%
MiddlewareMixin.__call__django/utils/deprecation.py:3093 ms6.1%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:553 ms6.1%
MiddlewareMixin.__call__django/utils/deprecation.py:3093 ms6.1%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:553 ms6.1%
MiddlewareMixin.__call__django/utils/deprecation.py:3093 ms6.1%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:553 ms6.1%
AccountMiddleware.<locals>.middlewareallauth/account/middleware.py:343 ms6.1%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:553 ms6.1%
BaseHandler._get_responsedjango/core/handlers/base.py:1983 ms6.1%
user_passes_test.<locals>.decorator.<locals>._view_wrapperdjango/contrib/auth/decorators.py:593 ms6.1%
homeapps/orgs/views.py:723 ms6.1%
current_organizationapps/orgs/views.py:543 ms6.1%
ensure_organizationapps/orgs/models.py:126 membership = Membership.objects.filter(user=user).select_related("organization").order_by("id").first()3 ms6.1%
QuerySet.firstdjango/db/models/query.py:11453 ms6.1%
QuerySet.__iter__django/db/models/query.py:3903 ms6.1%
QuerySet._fetch_alldjango/db/models/query.py:20003 ms6.1%
ModelIterable.__iter__django/db/models/query.py:953 ms6.1%
SQLCompiler.execute_sqldjango/db/models/sql/compiler.py:16113 ms6.1%
SQLCompiler.as_sqldjango/db/models/sql/compiler.py:7673 ms6.1%
SQLCompiler.pre_sql_setupdjango/db/models/sql/compiler.py:863 ms6.1%
SQLCompiler.setup_querydjango/db/models/sql/compiler.py:753 ms6.1%
SQLCompiler.get_selectdjango/db/models/sql/compiler.py:2553 ms6.1%
SQLCompiler.get_default_columnsdjango/db/models/sql/compiler.py:10303 ms6.1%
TestProjectsHome.test_user_logged_in_with_multiple_projectsft/tests.py:57 self.client.force_login(user)13 ms30.7%
ClientMixin.force_logindjango/test/client.py:85513 ms30.7%
ClientMixin._logindjango/test/client.py:8765 ms12.3%
ClientMixin.sessiondjango/test/client.py:8113 ms6.1%
ClientMixin.sessiondjango/test/client.py:8123 ms6.1%
SessionStore.savedjango/contrib/sessions/backends/db.py:1213 ms6.1%
SessionStore.createdjango/contrib/sessions/backends/db.py:743 ms6.1%
SessionStore.savedjango/contrib/sessions/backends/db.py:1273 ms6.1%
Model.savedjango/db/models/base.py:8743 ms6.1%
Model.save_basedjango/db/models/base.py:9663 ms6.1%
Model._save_tabledjango/db/models/base.py:11673 ms6.1%
Model._do_insertdjango/db/models/base.py:12183 ms6.1%
BaseManager._get_queryset_methods.<locals>.create_method.<locals>.manager_methoddjango/db/models/manager.py:873 ms6.1%
QuerySet._insertdjango/db/models/query.py:19183 ms6.1%
SQLInsertCompiler.execute_sqldjango/db/models/sql/compiler.py:19253 ms6.1%
CursorWrapper.executedjango/db/backends/utils.py:793 ms6.1%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:923 ms6.1%
CursorWrapper._executedjango/db/backends/utils.py:1053 ms6.1%
Cursor.executepsycopg/cursor.py:1133 ms6.1%
Connection.waitpsycopg/connection.py:4953 ms6.1%
ClientMixin._logindjango/test/client.py:8815 ms12.3%
logindjango/contrib/auth/__init__.py:1873 ms6.1%
SessionBase.cycle_keydjango/contrib/sessions/backends/base.py:4343 ms6.1%
SessionStore.createdjango/contrib/sessions/backends/db.py:703 ms6.1%
SessionBase._get_new_session_keydjango/contrib/sessions/backends/base.py:1983 ms6.1%
SessionStore.existsdjango/contrib/sessions/backends/db.py:633 ms6.1%
QuerySet.existsdjango/db/models/query.py:13373 ms6.1%
Query.has_resultsdjango/db/models/sql/query.py:6793 ms6.1%
Query.existsdjango/db/models/sql/query.py:6753 ms6.1%
logindjango/contrib/auth/__init__.py:1973 ms6.1%
Signal.senddjango/dispatch/dispatcher.py:2093 ms6.1%
update_last_logindjango/contrib/auth/models.py:183 ms6.1%
ClientMixin._logindjango/test/client.py:8833 ms6.1%
SessionStore.savedjango/contrib/sessions/backends/db.py:1273 ms6.1%
Model.savedjango/db/models/base.py:8743 ms6.1%
Model.save_basedjango/db/models/base.py:9663 ms6.1%
Model._save_tabledjango/db/models/base.py:11103 ms6.1%
Model._do_updatedjango/db/models/base.py:12113 ms6.1%
QuerySet._updatedjango/db/models/query.py:13273 ms6.1%
SQLUpdateCompiler.execute_returning_sqldjango/db/models/sql/compiler.py:21403 ms6.1%
SQLUpdateCompiler.execute_sqldjango/db/models/sql/compiler.py:21113 ms6.1%
SQLCompiler.execute_sqldjango/db/models/sql/compiler.py:16243 ms6.1%
CursorWrapper.executedjango/db/backends/utils.py:793 ms6.1%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:923 ms6.1%
CursorWrapper._executedjango/db/backends/utils.py:1053 ms6.1%
Cursor.executepsycopg/cursor.py:1133 ms6.1%
Connection.waitpsycopg/connection.py:4953 ms6.1%
TestProjectsHome.test_user_logged_in_with_multiple_projectsft/tests.py:53 user = User.objects.create_user("testuser")3 ms6.1%
UserManager.create_userdjango/contrib/auth/models.py:1753 ms6.1%
UserManager._create_userdjango/contrib/auth/models.py:1633 ms6.1%
AbstractBaseUser.savedjango/contrib/auth/base_user.py:623 ms6.1%
Model.savedjango/db/models/base.py:8743 ms6.1%
Model.save_basedjango/db/models/base.py:9663 ms6.1%
Model._save_tabledjango/db/models/base.py:11673 ms6.1%
Model._do_insertdjango/db/models/base.py:12183 ms6.1%
BaseManager._get_queryset_methods.<locals>.create_method.<locals>.manager_methoddjango/db/models/manager.py:873 ms6.1%
QuerySet._insertdjango/db/models/query.py:19183 ms6.1%
SQLInsertCompiler.execute_sqldjango/db/models/sql/compiler.py:19353 ms6.1%
BaseDatabaseOperations.fetch_returned_rowsdjango/db/backends/base/operations.py:3783 ms6.1%
TestProjectsHome.test_user_logged_in_with_multiple_projectsft/tests.py:543 ms6.1%
make_projectapps/projects/testing.py:64 project = Project.objects.create(3 ms6.1%
BaseManager._get_queryset_methods.<locals>.create_method.<locals>.manager_methoddjango/db/models/manager.py:873 ms6.1%
QuerySet.createdjango/db/models/query.py:6693 ms6.1%
Model.savedjango/db/models/base.py:8743 ms6.1%
Model.save_basedjango/db/models/base.py:9663 ms6.1%
Model._save_tabledjango/db/models/base.py:11673 ms6.1%
Model._do_insertdjango/db/models/base.py:12183 ms6.1%
BaseManager._get_queryset_methods.<locals>.create_method.<locals>.manager_methoddjango/db/models/manager.py:873 ms6.1%
QuerySet._insertdjango/db/models/query.py:19183 ms6.1%
SQLInsertCompiler.execute_sqldjango/db/models/sql/compiler.py:19253 ms6.1%
CursorWrapper.executedjango/db/backends/utils.py:793 ms6.1%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:923 ms6.1%
CursorWrapper._executedjango/db/backends/utils.py:1053 ms6.1%
Cursor.executepsycopg/cursor.py:1133 ms6.1%
Connection.waitpsycopg/connection.py:4953 ms6.1%
TestProjectsHome.test_user_logged_in_with_multiple_projectsft/tests.py:563 ms6.1%
make_projectapps/projects/testing.py:673 ms6.1%
unique_slugapps/orgs/models.py:46 while slug in reserved or taken.filter(slug=slug).exists():3 ms6.1%
QuerySet.filterdjango/db/models/query.py:15423 ms6.1%
QuerySet._filter_or_excludedjango/db/models/query.py:15603 ms6.1%
QuerySet._filter_or_exclude_inplacedjango/db/models/query.py:15703 ms6.1%
Query.add_qdjango/db/models/sql/query.py:16713 ms6.1%
TransactionTestCase._post_teardowndjango/test/testcases.py:1240 self._fixture_teardown()3 ms6.1%
TestCase._fixture_teardowndjango/test/testcases.py:14953 ms6.1%
DatabaseWrapper.check_constraintsdjango/db/backends/postgresql/base.py:4833 ms6.1%
CursorWrapper.executedjango/db/backends/utils.py:793 ms6.1%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:923 ms6.1%
CursorWrapper._executedjango/db/backends/utils.py:1033 ms6.1%
Cursor.executepsycopg/cursor.py:1133 ms6.1%
Connection.waitpsycopg/connection.py:4953 ms6.1%
Estimated from 16 samples; phase durations are exact. Frames from pytest and pluggy are hidden .

Hot lines in your code

ft/tests.py:58
response = self.client.get(reverse("projects"))
TestProjectsHome.test_user_logged_in_with_multiple_projects · Libraries
16 ms
ft/tests.py:57
self.client.force_login(user)
TestProjectsHome.test_user_logged_in_with_multiple_projects · Database
13 ms
ft/tests.py:53
user = User.objects.create_user("testuser")
TestProjectsHome.test_user_logged_in_with_multiple_projects · Database
3 ms
apps/projects/testing.py:64
project = Project.objects.create(
make_project · Database
3 ms
apps/orgs/models.py:46
while slug in reserved or taken.filter(slug=slug).exists():
unique_slug · Database
3 ms
apps/orgs/models.py:126
membership = Membership.objects.filter(user=user).select_related("organization").order_by("id").first()
ensure_organization · Database
3 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
_live_server_helper function 0.03 ms
_django_set_urlconf function 0.03 ms
_django_clear_site_cache function 0.02 ms
monkeypatch function 0.02 ms

Database

37 queries · 7 ms

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

3×
SELECT %s AS "a" FROM "projects_project" WHERE ("projects_project"."organization_id" = %s AND "projects_project"."slug" = %s) LIMIT ?

Biggest pieces of work

call test body
ft/tests.py:53
39 ms
call _post_teardown
django/test/testcases.py:1240
3 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 42 ms cb18ed3 main Profile
2 weeks, 4 days ago CI github-actions:test passed 53 ms 9bd5864 main Profile
2 weeks, 6 days ago CI github-actions:test passed 30 ms 19dac9b main Profile
3 weeks ago CI github-actions:test passed 53 ms e141198 main Profile
1 month ago CI github-actions:test passed 29 ms 46ec2aa main Profile
1 month ago CI github-actions:test passed 61 ms afde85b main Profile
1 month ago CI github-actions:test passed 61 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 58 ms 43c4eda main Profile
1 month, 1 week ago CI github-actions:test passed 58 ms 9caa567 main Profile
1 month, 1 week ago CI github-actions:test passed 56 ms ec75501 main Profile
1 month, 1 week ago CI github-actions:test passed 62 ms d2c12e5 main Profile
1 month, 1 week ago CI github-actions:test passed 28 ms 0b902f6 main Profile
1 month, 1 week ago CI github-actions:test passed 56 ms 78a4357 main Profile