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

LegacyUrlTest::test_private_projects_stay_private

First seen 3 weeks ago in 78a4357
CI github-actions:test 12 runs
Average
51 ms
median 53 ms
max 78 ms
Phases
Setup 0.70 ms Call 49 ms Teardown 1 ms
Categories
Database 18 ms Other (Libraries, Unsampled, pytest, Deep copies, ...) 32 ms

27 database queries per run

Needs 559 KB of memory (max 824 KB)

Duration per run

Where the time goes

Latest run in ci:github-actions:test, 16 hours ago · open run
Show pytest frames
setup0.77 ms1.3%
call54 ms92.4%
LegacyUrlTest.test_private_projects_stay_privateapps/projects/tests.py:399 self.client.force_login(User.objects.create_user("stranger"))32 ms54.6%
ClientMixin.force_logindjango/test/client.py:85532 ms54.6%
ClientMixin._logindjango/test/client.py:88132 ms54.6%
logindjango/contrib/auth/__init__.py:18730 ms50.4%
SessionBase.cycle_keydjango/contrib/sessions/backends/base.py:43427 ms46.2%
SessionStore.createdjango/contrib/sessions/backends/db.py:7427 ms46.2%
SessionStore.savedjango/contrib/sessions/backends/db.py:12725 ms42.0%
Model.savedjango/db/models/base.py:87425 ms42.0%
Model.save_basedjango/db/models/base.py:96622 ms37.8%
Model._save_tabledjango/db/models/base.py:116722 ms37.8%
Model._do_insertdjango/db/models/base.py:121822 ms37.8%
BaseManager._get_queryset_methods.<locals>.create_method.<locals>.manager_methoddjango/db/models/manager.py:8722 ms37.8%
QuerySet._insertdjango/db/models/query.py:191822 ms37.8%
SQLInsertCompiler.execute_sqldjango/db/models/sql/compiler.py:192520 ms33.6%
CursorWrapper.executedjango/db/backends/utils.py:7920 ms33.6%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:9220 ms33.6%
CursorWrapper._executedjango/db/backends/utils.py:10520 ms33.6%
Cursor.executepsycopg/cursor.py:11320 ms33.6%
Connection.waitpsycopg/connection.py:49520 ms33.6%
BaseCursor._execute_genpsycopg/_cursor_base.py:20620 ms33.6%
BaseCursor._maybe_prepare_genpsycopg/_cursor_base.py:28617 ms29.4%
ClientCursorMixin._execute_sendpsycopg/client_cursor.py:7817 ms29.4%
BaseCursor._maybe_prepare_genpsycopg/_cursor_base.py:3122 ms4.2%
SQLInsertCompiler.execute_sqldjango/db/models/sql/compiler.py:19232 ms4.2%
async_unsafe.<locals>.decorator.<locals>.innerdjango/utils/asyncio.py:262 ms4.2%
BaseDatabaseWrapper.cursordjango/db/backends/base/base.py:3202 ms4.2%
BaseDatabaseWrapper._cursordjango/db/backends/base/base.py:2982 ms4.2%
async_unsafe.<locals>.decorator.<locals>.innerdjango/utils/asyncio.py:262 ms4.2%
DatabaseWrapper.create_cursordjango/db/backends/postgresql/base.py:4302 ms4.2%
Connection.cursorpsycopg/connection.py:2592 ms4.2%
SessionStore.savedjango/contrib/sessions/backends/db.py:1262 ms4.2%
Atomic.__exit__django/db/transaction.py:2472 ms4.2%
async_unsafe.<locals>.decorator.<locals>.innerdjango/utils/asyncio.py:262 ms4.2%
BaseDatabaseWrapper.savepoint_commitdjango/db/backends/base/base.py:4312 ms4.2%
BaseDatabaseWrapper._savepoint_commitdjango/db/backends/base/base.py:3752 ms4.2%
CursorWrapper.executedjango/db/backends/utils.py:792 ms4.2%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:922 ms4.2%
CursorWrapper._executedjango/db/backends/utils.py:1032 ms4.2%
Cursor.executepsycopg/cursor.py:1132 ms4.2%
Connection.waitpsycopg/connection.py:4952 ms4.2%
SessionBase.cycle_keydjango/contrib/sessions/backends/base.py:4372 ms4.2%
SessionStore.deletedjango/contrib/sessions/backends/db.py:1752 ms4.2%
BaseManager._get_queryset_methods.<locals>.create_method.<locals>.manager_methoddjango/db/models/manager.py:872 ms4.2%
QuerySet.getdjango/db/models/query.py:6352 ms4.2%
QuerySet.__len__django/db/models/query.py:3722 ms4.2%
QuerySet._fetch_alldjango/db/models/query.py:20002 ms4.2%
ModelIterable.__iter__django/db/models/query.py:952 ms4.2%
SQLCompiler.execute_sqldjango/db/models/sql/compiler.py:16242 ms4.2%
CursorWrapper.executedjango/db/backends/utils.py:792 ms4.2%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:922 ms4.2%
CursorWrapper._executedjango/db/backends/utils.py:1052 ms4.2%
Cursor.executepsycopg/cursor.py:1132 ms4.2%
Connection.waitpsycopg/connection.py:4952 ms4.2%
BaseCursor._execute_genpsycopg/_cursor_base.py:2062 ms4.2%
BaseCursor._maybe_prepare_genpsycopg/_cursor_base.py:2862 ms4.2%
ClientCursorMixin._execute_sendpsycopg/client_cursor.py:782 ms4.2%
logindjango/contrib/auth/__init__.py:1972 ms4.2%
Signal.senddjango/dispatch/dispatcher.py:2092 ms4.2%
update_last_logindjango/contrib/auth/models.py:242 ms4.2%
AbstractBaseUser.savedjango/contrib/auth/base_user.py:622 ms4.2%
Model.savedjango/db/models/base.py:8742 ms4.2%
Model.save_basedjango/db/models/base.py:9662 ms4.2%
LegacyUrlTest.test_private_projects_stay_privateapps/projects/tests.py:397 response = self.client.get(f"/projects/{self.project.id}/")22 ms37.8%
Client.getdjango/test/client.py:112422 ms37.8%
RequestFactory.getdjango/test/client.py:47522 ms37.8%
RequestFactory.genericdjango/test/client.py:67122 ms37.8%
Client.requestdjango/test/client.py:108222 ms37.8%
ClientHandler.__call__django/test/client.py:17322 ms37.8%
BaseHandler.load_middlewaredjango/core/handlers/base.py:6222 ms37.8%
WhiteNoiseMiddleware.__init__whitenoise/middleware.py:10422 ms37.8%
WhiteNoise.add_fileswhitenoise/base.py:10822 ms37.8%
WhiteNoise.update_files_dictionarywhitenoise/base.py:12020 ms33.6%
WhiteNoise.add_file_to_dictionarywhitenoise/base.py:13120 ms33.6%
WhiteNoise.get_static_filewhitenoise/base.py:20817 ms29.4%
StaticFile.__init__whitenoise/responders.py:7210 ms16.8%
StaticFile.get_file_statswhitenoise/responders.py:16110 ms16.8%
__init____init__:-110 ms16.8%
FileEntry.__init__whitenoise/responders.py:26310 ms16.8%
FileEntry.stat_regular_filewhitenoise/responders.py:27610 ms16.8%
<GC>~10 ms16.8%
StaticFile.__init__whitenoise/responders.py:735 ms8.4%
StaticFile.get_headerswhitenoise/responders.py:1762 ms4.2%
formatdate<stdlib>/email/utils.py:2662 ms4.2%
format_datetime<stdlib>/email/utils.py:2842 ms4.2%
StaticFile.__init__whitenoise/responders.py:742 ms4.2%
parsedate<stdlib>/email/_parseaddr.py:1852 ms4.2%
WhiteNoise.get_static_filewhitenoise/base.py:2022 ms4.2%
WhiteNoise.add_mime_headerswhitenoise/base.py:2212 ms4.2%
WhiteNoise.update_files_dictionarywhitenoise/base.py:1152 ms4.2%
scantreewhitenoise/base.py:2622 ms4.2%
scantreewhitenoise/base.py:2622 ms4.2%
scantreewhitenoise/base.py:2642 ms4.2%
Estimated from 23 samples; phase durations are exact. Frames from pytest and pluggy are hidden .

Hot lines in your code

apps/projects/tests.py:399
self.client.force_login(User.objects.create_user("stranger"))
LegacyUrlTest.test_private_projects_stay_private · Database
32 ms
apps/projects/tests.py:397
response = self.client.get(f"/projects/{self.project.id}/")
LegacyUrlTest.test_private_projects_stay_private · Libraries
22 ms

Fixtures

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

Database

27 queries · 10 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:399
54 ms
setup pytest internals 0.77 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 59 ms e141198 main Profile
1 week, 5 days ago CI github-actions:test passed 47 ms 46ec2aa main Profile
2 weeks, 1 day ago CI github-actions:test passed 60 ms afde85b main Profile
2 weeks, 1 day ago CI github-actions:test passed 35 ms fe29f9d main Profile
2 weeks, 1 day ago CI github-actions:test passed 78 ms 044719a main Profile
2 weeks, 2 days ago CI github-actions:test passed 31 ms b3fedae main Profile
2 weeks, 4 days ago CI github-actions:test passed 55 ms 43c4eda main Profile
2 weeks, 6 days ago CI github-actions:test passed 53 ms 9caa567 main Profile
2 weeks, 6 days ago CI github-actions:test passed 52 ms ec75501 main Profile
3 weeks ago CI github-actions:test passed 58 ms d2c12e5 main Profile
3 weeks ago CI github-actions:test passed 27 ms 0b902f6 main Profile
3 weeks ago CI github-actions:test passed 52 ms 78a4357 main Profile