flakytest.dev anze3db fedidevs
Tests / confs/tests.py

TestEditConference::test_staff_can_edit

First seen 12 hours ago in 0c23747
CI github-actions:test 4 runs
Average
1.38 s
median 1.30 s
max 2.19 s
Phases
Setup 2 ms Call 1.38 s Teardown 2 ms
Categories
Password hashing 1.29 s Database 22 ms Factories 1 ms Other (Libraries, pytest, Deep copies, Unsampled) 76 ms

31 database queries per run

Needs 342 KB of memory (max 944 KB)

Duration per run

Where the time goes

Latest run in ci:github-actions:test, 7 hours ago · open run
Show pytest frames
setup0.51 ms0.1%
call743 ms99.8%
TestEditConference.setUpconfs/tests.py:1176 self.other = User.objects.create_user("other", password="pw")241 ms32.4%
UserManager.create_userdjango/contrib/auth/models.py:180241 ms32.4%
UserManager._create_userdjango/contrib/auth/models.py:167240 ms32.3%
UserManager._create_user_objectdjango/contrib/auth/models.py:160240 ms32.3%
make_passworddjango/contrib/auth/hashers.py:118240 ms32.3%
PBKDF2PasswordHasher.encodedjango/contrib/auth/hashers.py:333240 ms32.3%
pbkdf2django/utils/crypto.py:93240 ms32.3%
1 smaller frames hidden
TestEditConference.setUpconfs/tests.py:1177 self.staff = User.objects.create_user("staff", password="pw", is_staff=True)241 ms32.4%
UserManager.create_userdjango/contrib/auth/models.py:180241 ms32.4%
UserManager._create_userdjango/contrib/auth/models.py:167240 ms32.3%
UserManager._create_user_objectdjango/contrib/auth/models.py:160240 ms32.3%
make_passworddjango/contrib/auth/hashers.py:118240 ms32.3%
PBKDF2PasswordHasher.encodedjango/contrib/auth/hashers.py:333240 ms32.3%
pbkdf2django/utils/crypto.py:93240 ms32.3%
1 smaller frames hidden
TestEditConference.setUpconfs/tests.py:1175 self.owner = User.objects.create_user("owner", password="pw")240 ms32.3%
UserManager.create_userdjango/contrib/auth/models.py:180240 ms32.3%
UserManager._create_userdjango/contrib/auth/models.py:167240 ms32.3%
UserManager._create_user_objectdjango/contrib/auth/models.py:160240 ms32.3%
make_passworddjango/contrib/auth/hashers.py:118240 ms32.3%
PBKDF2PasswordHasher.encodedjango/contrib/auth/hashers.py:333240 ms32.3%
pbkdf2django/utils/crypto.py:93240 ms32.3%
TestEditConference.test_staff_can_editconfs/tests.py:1230 self.client.post(self.url, self._post_data(name="Staff Edit"))16 ms2.1%
Client.postdjango/test/client.py:116216 ms2.1%
RequestFactory.postdjango/test/client.py:49916 ms2.1%
RequestFactory.genericdjango/test/client.py:67116 ms2.1%
Client.requestdjango/test/client.py:109116 ms2.1%
ClientHandler.__call__django/test/client.py:17310 ms1.4%
BaseHandler.load_middlewaredjango/core/handlers/base.py:6310 ms1.4%
WhiteNoiseMiddleware.__init__whitenoise/middleware.py:10410 ms1.4%
WhiteNoise.add_fileswhitenoise/base.py:10810 ms1.4%
WhiteNoise.update_files_dictionarywhitenoise/base.py:1206 ms0.8%
WhiteNoise.add_file_to_dictionarywhitenoise/base.py:1316 ms0.8%
WhiteNoise.get_static_filewhitenoise/base.py:2175 ms0.7%
WhiteNoise.update_files_dictionarywhitenoise/base.py:1154 ms0.6%
scantreewhitenoise/base.py:2714 ms0.6%
ClientHandler.__call__django/test/client.py:1864 ms0.6%
BaseHandler.get_responsedjango/core/handlers/base.py:1424 ms0.6%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:564 ms0.6%
MiddlewareMixin.__call__django/utils/deprecation.py:3804 ms0.6%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:564 ms0.6%
MiddlewareMixin.__call__django/utils/deprecation.py:3804 ms0.6%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:564 ms0.6%
MiddlewareMixin.__call__django/utils/deprecation.py:3804 ms0.6%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:564 ms0.6%
WhiteNoiseMiddleware.__call__whitenoise/middleware.py:1234 ms0.6%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:564 ms0.6%
DebugToolbarMiddleware.__call__debug_toolbar/middleware.py:1454 ms0.6%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:564 ms0.6%
MiddlewareMixin.__call__django/utils/deprecation.py:3804 ms0.6%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:564 ms0.6%
MiddlewareMixin.__call__django/utils/deprecation.py:3804 ms0.6%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:564 ms0.6%
MiddlewareMixin.__call__django/utils/deprecation.py:3804 ms0.6%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:564 ms0.6%
MiddlewareMixin.__call__django/utils/deprecation.py:3804 ms0.6%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:564 ms0.6%
MiddlewareMixin.__call__django/utils/deprecation.py:3804 ms0.6%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:564 ms0.6%
MiddlewareMixin.__call__django/utils/deprecation.py:3804 ms0.6%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:564 ms0.6%
MiddlewareMixin.__call__django/utils/deprecation.py:3804 ms0.6%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:564 ms0.6%
BaseHandler._get_responsedjango/core/handlers/base.py:1994 ms0.6%
user_passes_test.<locals>.decorator.<locals>._view_wrapperdjango/contrib/auth/decorators.py:624 ms0.6%
1 smaller frames hidden
5 smaller frames hidden
teardown0.87 ms0.1%
Estimated from 720 samples; phase durations are exact. Frames from pytest and pluggy are hidden .

Hot lines in your code

confs/tests.py:1176
self.other = User.objects.create_user("other", password="pw")
TestEditConference.setUp · Password hashing
241 ms
confs/tests.py:1177
self.staff = User.objects.create_user("staff", password="pw", is_staff=True)
TestEditConference.setUp · Password hashing
241 ms
confs/tests.py:1175
self.owner = User.objects.create_user("owner", password="pw")
TestEditConference.setUp · Password hashing
240 ms
confs/tests.py:1230
self.client.post(self.url, self._post_data(name="Staff Edit"))
TestEditConference.test_staff_can_edit · Libraries
11 ms
confs/views.py:543
form.save()
edit_conference · Database
2 ms
confs/tests.py:1178
self.conference = baker.make(
TestEditConference.setUp · Factories
1 ms
confs/tests.py:1187
self.url = reverse("edit_conference", kwargs={"conference_slug": self.conference.slug})
TestEditConference.setUp · Libraries
1 ms
confs/tests.py:1229
self.client.force_login(self.staff)
TestEditConference.test_staff_can_edit · Database
1 ms
confs/views.py:536
conference = get_object_or_404(Conference, slug=conference_slug)
edit_conference · Database
1 ms
confs/views.py:420
super().__init__(*args, **kwargs)
ConferenceForm.__init__ · Deep copies
1 ms

Fixtures

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

Database

31 queries · 8 ms

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

3×
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"

Biggest pieces of work

call setUp
confs/tests.py:1175
724 ms
call test body
confs/tests.py:1230
18 ms
call _post_teardown
django/test/testcases.py:1243
1 ms
teardown tearDownClass
django/test/testcases.py:1456
0.87 ms
setup pytest internals 0.51 ms

Reliability

5 results · 0 CI failures · 0 local failures

This test hasn't failed recently.

History

Latest 5 results, oldest first in the strip
When Environment Outcome Duration Commit
7 hours ago CI github-actions:test passed 744 ms d923a46 main Profile
7 hours ago CI github-actions:test passed 1.64 s 82997f8 main Profile
7 hours ago CI github-actions:test passed 961 ms 623aa3e main Profile
12 hours ago CI github-actions:test passed 2.19 s ab6465a main Profile
12 hours ago CI github-actions:test passed 917 ms 0c23747 main Run