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

TestEditConference::test_owner_can_edit_after_approval

First seen 12 hours ago in 0c23747
CI github-actions:test 4 runs
Average
2.33 s
median 2.55 s
max 3.32 s
Phases
Setup 3 ms Call 2.33 s Teardown 0.29 ms
Categories
Password hashing 2.20 s Database 41 ms Factories 0.93 ms Test code 0.68 ms Other (Libraries, Deep copies, pytest, Unsampled) 94 ms

32 database queries per run

Needs 19 KB of memory (max 76 KB)

Duration per run

Where the time goes

Latest run in ci:github-actions:test, 6 hours ago · open run
Show pytest frames
call920 ms99.9%
TestEditConference.setUpconfs/tests.py:1175 self.owner = User.objects.create_user("owner", password="pw")347 ms37.7%
UserManager.create_userdjango/contrib/auth/models.py:180347 ms37.7%
UserManager._create_userdjango/contrib/auth/models.py:167346 ms37.6%
UserManager._create_user_objectdjango/contrib/auth/models.py:160346 ms37.6%
make_passworddjango/contrib/auth/hashers.py:118346 ms37.6%
PBKDF2PasswordHasher.encodedjango/contrib/auth/hashers.py:333346 ms37.6%
pbkdf2django/utils/crypto.py:93346 ms37.6%
1 smaller frames hidden
TestEditConference.setUpconfs/tests.py:1177 self.staff = User.objects.create_user("staff", password="pw", is_staff=True)275 ms29.9%
UserManager.create_userdjango/contrib/auth/models.py:180275 ms29.9%
UserManager._create_userdjango/contrib/auth/models.py:167275 ms29.9%
UserManager._create_user_objectdjango/contrib/auth/models.py:160275 ms29.9%
make_passworddjango/contrib/auth/hashers.py:118275 ms29.9%
PBKDF2PasswordHasher.encodedjango/contrib/auth/hashers.py:333275 ms29.9%
pbkdf2django/utils/crypto.py:93275 ms29.9%
TestEditConference.setUpconfs/tests.py:1176 self.other = User.objects.create_user("other", password="pw")274 ms29.7%
UserManager.create_userdjango/contrib/auth/models.py:180274 ms29.7%
UserManager._create_userdjango/contrib/auth/models.py:167273 ms29.6%
UserManager._create_user_objectdjango/contrib/auth/models.py:160273 ms29.6%
make_passworddjango/contrib/auth/hashers.py:118273 ms29.6%
PBKDF2PasswordHasher.encodedjango/contrib/auth/hashers.py:333273 ms29.6%
pbkdf2django/utils/crypto.py:93273 ms29.6%
1 smaller frames hidden
TestEditConference.test_owner_can_edit_after_approvalconfs/tests.py:1247 response = self.client.post(self.url, self._post_data(name="Edited After Approval"))17 ms1.8%
Client.postdjango/test/client.py:116217 ms1.8%
RequestFactory.postdjango/test/client.py:49917 ms1.8%
RequestFactory.genericdjango/test/client.py:67117 ms1.8%
Client.requestdjango/test/client.py:109117 ms1.8%
ClientHandler.__call__django/test/client.py:17311 ms1.2%
BaseHandler.load_middlewaredjango/core/handlers/base.py:6311 ms1.2%
WhiteNoiseMiddleware.__init__whitenoise/middleware.py:10411 ms1.2%
WhiteNoise.add_fileswhitenoise/base.py:10811 ms1.2%
WhiteNoise.update_files_dictionarywhitenoise/base.py:1207 ms0.8%
WhiteNoise.add_file_to_dictionarywhitenoise/base.py:1317 ms0.8%
WhiteNoise.get_static_filewhitenoise/base.py:2175 ms0.6%
1 smaller frames hidden
1 smaller frames hidden
ClientHandler.__call__django/test/client.py:1865 ms0.6%
BaseHandler.get_responsedjango/core/handlers/base.py:1425 ms0.6%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:565 ms0.6%
MiddlewareMixin.__call__django/utils/deprecation.py:3805 ms0.6%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:565 ms0.6%
3 smaller frames hidden
Estimated from 890 samples; phase durations are exact. Frames from pytest and pluggy are hidden .

Hot lines in your code

confs/tests.py:1175
self.owner = User.objects.create_user("owner", password="pw")
TestEditConference.setUp · Password hashing
347 ms
confs/tests.py:1177
self.staff = User.objects.create_user("staff", password="pw", is_staff=True)
TestEditConference.setUp · Password hashing
275 ms
confs/tests.py:1176
self.other = User.objects.create_user("other", password="pw")
TestEditConference.setUp · Password hashing
274 ms
confs/tests.py:1247
response = self.client.post(self.url, self._post_data(name="Edited After Approval"))
TestEditConference.test_owner_can_edit_after_approval · Libraries
12 ms
confs/tests.py:1246
self.client.force_login(self.owner)
TestEditConference.test_owner_can_edit_after_approval · Database
3 ms
confs/tests.py:1178
self.conference = baker.make(
TestEditConference.setUp · Factories
2 ms
confs/tests.py:1244
self.conference.save(update_fields=["approved_at"])
TestEditConference.test_owner_can_edit_after_approval · 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
confs/views.py:428
if tags and len(tags) > MAX_CONFERENCE_TAGS:
ConferenceForm.clean_conference_tags · Database
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.03 ms
_django_isolate_apps function 0.02 ms
_django_set_urlconf function 0.02 ms
_live_server_helper function 0.02 ms
_django_clear_site_cache function 0.02 ms
monkeypatch function 0.01 ms

Database

32 queries · 10 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
898 ms
call test body
confs/tests.py:1247
21 ms
call pytest internals 1 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
6 hours ago CI github-actions:test passed 921 ms d923a46 main Profile
6 hours ago CI github-actions:test passed 2.94 s 82997f8 main Profile
7 hours ago CI github-actions:test passed 2.15 s 623aa3e main Profile
11 hours ago CI github-actions:test passed 3.32 s ab6465a main Profile
12 hours ago CI github-actions:test passed 1.37 s 0c23747 main Run