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

TestEditConference::test_owner_can_edit_after_approval

First seen 3 weeks ago in 0c23747
CI github-actions:test 11 runs
Average
1.63 s
median 1.36 s
max 3.32 s
Phases
Setup 2 ms Call 1.63 s Teardown 0.32 ms
Categories
Password hashing 1.54 s Database 29 ms Factories 0.52 ms Test code 0.25 ms Other (Libraries, Deep copies, pytest, Unsampled) 61 ms

32 database queries per run

Needs 11 KB of memory (max 76 KB)

Duration per run

Where the time goes

Latest run in ci:github-actions:test, 7 hours ago · open run
Show pytest frames
call1.21 s99.9%
TestEditConference.setUpconfs/tests.py:1175 self.owner = User.objects.create_user("owner", password="pw")512 ms42.4%
UserManager.create_userdjango/contrib/auth/models.py:180512 ms42.4%
UserManager._create_userdjango/contrib/auth/models.py:167510 ms42.2%
UserManager._create_user_objectdjango/contrib/auth/models.py:160510 ms42.2%
make_passworddjango/contrib/auth/hashers.py:118510 ms42.2%
PBKDF2PasswordHasher.encodedjango/contrib/auth/hashers.py:333510 ms42.2%
pbkdf2django/utils/crypto.py:93510 ms42.2%
1 smaller frames hidden
TestEditConference.setUpconfs/tests.py:1176 self.other = User.objects.create_user("other", password="pw")325 ms26.9%
UserManager.create_userdjango/contrib/auth/models.py:180325 ms26.9%
UserManager._create_userdjango/contrib/auth/models.py:167325 ms26.9%
UserManager._create_user_objectdjango/contrib/auth/models.py:160325 ms26.9%
make_passworddjango/contrib/auth/hashers.py:118325 ms26.9%
PBKDF2PasswordHasher.encodedjango/contrib/auth/hashers.py:333325 ms26.9%
pbkdf2django/utils/crypto.py:93325 ms26.9%
TestEditConference.setUpconfs/tests.py:1177 self.staff = User.objects.create_user("staff", password="pw", is_staff=True)325 ms26.9%
UserManager.create_userdjango/contrib/auth/models.py:180325 ms26.9%
UserManager._create_userdjango/contrib/auth/models.py:167324 ms26.9%
UserManager._create_user_objectdjango/contrib/auth/models.py:160324 ms26.9%
make_passworddjango/contrib/auth/hashers.py:118324 ms26.9%
PBKDF2PasswordHasher.encodedjango/contrib/auth/hashers.py:333324 ms26.9%
pbkdf2django/utils/crypto.py:93324 ms26.9%
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"))30 ms2.5%
Client.postdjango/test/client.py:116230 ms2.5%
RequestFactory.postdjango/test/client.py:49929 ms2.4%
RequestFactory.genericdjango/test/client.py:67129 ms2.4%
Client.requestdjango/test/client.py:109129 ms2.4%
ClientHandler.__call__django/test/client.py:17323 ms1.9%
BaseHandler.load_middlewaredjango/core/handlers/base.py:6323 ms1.9%
WhiteNoiseMiddleware.__init__whitenoise/middleware.py:10423 ms1.9%
WhiteNoise.add_fileswhitenoise/base.py:10823 ms1.9%
WhiteNoise.update_files_dictionarywhitenoise/base.py:12016 ms1.3%
WhiteNoise.add_file_to_dictionarywhitenoise/base.py:13116 ms1.3%
WhiteNoise.get_static_filewhitenoise/base.py:2179 ms0.8%
2 smaller frames hidden
WhiteNoise.update_files_dictionarywhitenoise/base.py:1156 ms0.5%
ClientHandler.__call__django/test/client.py:1866 ms0.5%
1 smaller frames hidden
TestEditConference.test_owner_can_edit_after_approvalconfs/tests.py:1246 self.client.force_login(self.owner)7 ms0.6%
ClientMixin.force_logindjango/test/client.py:8587 ms0.6%
4 smaller frames hidden
Estimated from 1,164 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
512 ms
confs/tests.py:1176
self.other = User.objects.create_user("other", password="pw")
TestEditConference.setUp · Password hashing
325 ms
confs/tests.py:1177
self.staff = User.objects.create_user("staff", password="pw", is_staff=True)
TestEditConference.setUp · Password hashing
325 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
27 ms
confs/tests.py:1246
self.client.force_login(self.owner)
TestEditConference.test_owner_can_edit_after_approval · Database
7 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:543
form.save()
edit_conference · Database
1 ms

Fixtures

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

Database

32 queries · 13 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
1.16 s
call test body
confs/tests.py:1247
39 ms
call _post_teardown
django/test/testcases.py:1243
2 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
7 hours ago CI github-actions:test passed 1.21 s c28a326 main Profile
16 hours ago CI github-actions:test passed 735 ms 9b8826a main Profile
22 hours ago CI github-actions:test passed 1.32 s 4f01055 main Profile
1 week, 5 days ago CI github-actions:test passed 1.11 s 8ab642e main Profile
2 weeks, 2 days ago CI github-actions:test passed 1.36 s 9b75244 main Profile
2 weeks, 2 days ago CI github-actions:test passed 1.37 s 9603516 main Profile
2 weeks, 4 days ago CI github-actions:test passed 1.46 s 615a272 main Profile
3 weeks ago CI github-actions:test passed 921 ms d923a46 main Profile
3 weeks ago CI github-actions:test passed 2.94 s 82997f8 main Profile
3 weeks ago CI github-actions:test passed 2.15 s 623aa3e main Profile
3 weeks ago CI github-actions:test passed 3.32 s ab6465a main Profile
3 weeks ago CI github-actions:test passed 1.37 s 0c23747 main Run