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

TestAnonymousCacheAndCsrf::test_authenticated_html_is_private_and_keeps_csrf_header

First seen 3 weeks ago in 0c23747
CI github-actions:test 11 runs
Average
1.31 s
median 1.19 s
max 2.12 s
Phases
Setup 3 ms Call 1.31 s Teardown 0.43 ms
Categories
Password hashing 1.18 s Database 52 ms App code 1 ms Other (Libraries, Templates, pytest, Unsampled, ...) 78 ms

31 database queries per run

Needs 92 KB of memory (max 892 KB)

Duration per run

Where the time goes

Latest run in ci:github-actions:test, 7 hours ago · open run
Show pytest frames
call1.32 s99.9%
TestAnonymousCacheAndCsrf.test_authenticated_html_is_private_and_keeps_csrf_headerfedidevs/tests.py:63 User.objects.create_user("alice", password="pw")605 ms45.7%
UserManager.create_userdjango/contrib/auth/models.py:180605 ms45.7%
UserManager._create_userdjango/contrib/auth/models.py:167599 ms45.2%
UserManager._create_user_objectdjango/contrib/auth/models.py:160599 ms45.2%
make_passworddjango/contrib/auth/hashers.py:118599 ms45.2%
PBKDF2PasswordHasher.encodedjango/contrib/auth/hashers.py:333599 ms45.2%
pbkdf2django/utils/crypto.py:93599 ms45.2%
UserManager._create_userdjango/contrib/auth/models.py:1687 ms0.5%
AbstractBaseUser.savedjango/contrib/auth/base_user.py:627 ms0.5%
Model.savedjango/db/models/base.py:9047 ms0.5%
Model.save_basedjango/db/models/base.py:9967 ms0.5%
Model._save_tabledjango/db/models/base.py:11997 ms0.5%
Model._do_insertdjango/db/models/base.py:12517 ms0.5%
BaseManager._get_queryset_methods.<locals>.create_method.<locals>.manager_methoddjango/db/models/manager.py:877 ms0.5%
QuerySet._insertdjango/db/models/query.py:21417 ms0.5%
TestAnonymousCacheAndCsrf.test_authenticated_html_is_private_and_keeps_csrf_headerfedidevs/tests.py:64 self.client.login(username="alice", password="pw")577 ms43.6%
ClientMixin.logindjango/test/client.py:838570 ms43.0%
sensitive_variables.<locals>.decorator.<locals>.sensitive_variables_wrapperdjango/views/decorators/debug.py:74570 ms43.0%
authenticatedjango/contrib/auth/__init__.py:130570 ms43.0%
sensitive_variables.<locals>.decorator.<locals>.sensitive_variables_wrapperdjango/views/decorators/debug.py:74570 ms43.0%
ModelBackend.authenticatedjango/contrib/auth/backends.py:75563 ms42.5%
check_password_with_timing_attack_mitigationdjango/contrib/auth/__init__.py:399563 ms42.5%
AbstractBaseUser.check_passworddjango/contrib/auth/base_user.py:109563 ms42.5%
check_passworddjango/contrib/auth/hashers.py:83563 ms42.5%
verify_passworddjango/contrib/auth/hashers.py:63563 ms42.5%
PBKDF2PasswordHasher.verifydjango/contrib/auth/hashers.py:349563 ms42.5%
PBKDF2PasswordHasher.encodedjango/contrib/auth/hashers.py:333563 ms42.5%
pbkdf2django/utils/crypto.py:93563 ms42.5%
ModelBackend.authenticatedjango/contrib/auth/backends.py:717 ms0.5%
BaseUserManager.get_by_natural_keydjango/contrib/auth/base_user.py:377 ms0.5%
BaseManager._get_queryset_methods.<locals>.create_method.<locals>.manager_methoddjango/db/models/manager.py:877 ms0.5%
QuerySet.getdjango/db/models/query.py:7027 ms0.5%
QuerySet.__len__django/db/models/query.py:4217 ms0.5%
QuerySet._fetch_alldjango/db/models/query.py:22627 ms0.5%
ModelIterable.__iter__django/db/models/query.py:1037 ms0.5%
ClientMixin.logindjango/test/client.py:8408 ms0.6%
TestAnonymousCacheAndCsrf.test_authenticated_html_is_private_and_keeps_csrf_headerfedidevs/tests.py:65 response = self.client.get("/conferences/")97 ms7.3%
Client.getdjango/test/client.py:113397 ms7.3%
RequestFactory.getdjango/test/client.py:47597 ms7.3%
RequestFactory.genericdjango/test/client.py:67197 ms7.3%
Client.requestdjango/test/client.py:109197 ms7.3%
ClientHandler.__call__django/test/client.py:18684 ms6.4%
BaseHandler.get_responsedjango/core/handlers/base.py:14284 ms6.4%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5684 ms6.4%
MiddlewareMixin.__call__django/utils/deprecation.py:38084 ms6.4%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5684 ms6.4%
MiddlewareMixin.__call__django/utils/deprecation.py:38084 ms6.4%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5684 ms6.4%
MiddlewareMixin.__call__django/utils/deprecation.py:38084 ms6.4%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5684 ms6.4%
WhiteNoiseMiddleware.__call__whitenoise/middleware.py:12384 ms6.4%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5684 ms6.4%
DebugToolbarMiddleware.__call__debug_toolbar/middleware.py:14584 ms6.4%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5684 ms6.4%
MiddlewareMixin.__call__django/utils/deprecation.py:38084 ms6.4%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5684 ms6.4%
MiddlewareMixin.__call__django/utils/deprecation.py:38084 ms6.4%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5684 ms6.4%
MiddlewareMixin.__call__django/utils/deprecation.py:38084 ms6.4%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5684 ms6.4%
MiddlewareMixin.__call__django/utils/deprecation.py:38084 ms6.4%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5684 ms6.4%
MiddlewareMixin.__call__django/utils/deprecation.py:38084 ms6.4%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5684 ms6.4%
MiddlewareMixin.__call__django/utils/deprecation.py:38084 ms6.4%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5684 ms6.4%
MiddlewareMixin.__call__django/utils/deprecation.py:38084 ms6.4%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5684 ms6.4%
BaseHandler._get_responsedjango/core/handlers/base.py:19984 ms6.4%
conferencesconfs/views.py:85 if request.user.is_authenticated:51 ms3.9%
new_method_proxy.<locals>.innerdjango/utils/functional.py:25151 ms3.9%
SimpleLazyObject._setupdjango/utils/functional.py:40451 ms3.9%
AuthenticationMiddleware.process_request.<locals>.<lambda>django/contrib/auth/middleware.py:3951 ms3.9%
get_userdjango/contrib/auth/middleware.py:1951 ms3.9%
get_userdjango/contrib/auth/__init__.py:28750 ms3.8%
_get_user_session_keydjango/contrib/auth/__init__.py:11150 ms3.8%
SessionBase.__getitem__django/contrib/sessions/backends/base.py:5550 ms3.8%
SessionBase._get_sessiondjango/contrib/sessions/backends/base.py:25450 ms3.8%
SessionStore.loaddjango/contrib/sessions/backends/db.py:5550 ms3.8%
SessionStore._get_session_from_dbdjango/contrib/sessions/backends/db.py:3450 ms3.8%
BaseManager._get_queryset_methods.<locals>.create_method.<locals>.manager_methoddjango/db/models/manager.py:8750 ms3.8%
QuerySet.getdjango/db/models/query.py:70250 ms3.8%
QuerySet.__len__django/db/models/query.py:42150 ms3.8%
QuerySet._fetch_alldjango/db/models/query.py:226250 ms3.8%
ModelIterable.__iter__django/db/models/query.py:10350 ms3.8%
SQLCompiler.execute_sqldjango/db/models/sql/compiler.py:162550 ms3.8%
CursorWrapper.executedjango/db/backends/utils.py:7950 ms3.8%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:9250 ms3.8%
CursorWrapper._executedjango/db/backends/utils.py:10550 ms3.8%
Cursor.executepsycopg/cursor.py:11350 ms3.8%
Connection.waitpsycopg/connection.py:49550 ms3.8%
1 smaller frames hidden
conferencesconfs/views.py:128 return render(28 ms2.1%
renderdjango/shortcuts.py:2728 ms2.1%
render_to_stringdjango/template/loader.py:6227 ms2.0%
Template.renderdjango/template/backends/django.py:10727 ms2.0%
Template.renderdjango/template/base.py:17527 ms2.0%
instrumented_test_renderdjango/test/utils.py:11327 ms2.0%
NodeList.renderdjango/template/base.py:110827 ms2.0%
Node.render_annotateddjango/template/base.py:106927 ms2.0%
ExtendsNode.renderdjango/template/loader_tags.py:16027 ms2.0%
instrumented_test_renderdjango/test/utils.py:11327 ms2.0%
NodeList.renderdjango/template/base.py:110827 ms2.0%
Node.render_annotateddjango/template/base.py:106927 ms2.0%
BlockNode.renderdjango/template/loader_tags.py:6625 ms1.9%
NodeList.renderdjango/template/base.py:110825 ms1.9%
Node.render_annotateddjango/template/base.py:106925 ms1.9%
SimpleNode.renderdjango/template/library.py:34325 ms1.9%
heroicon_outlineheroicons/templatetags/heroicons.py:2325 ms1.9%
_render_iconheroicons/templatetags/heroicons.py:4125 ms1.9%
_render_iconheroicons/__init__.py:4725 ms1.9%
_load_iconheroicons/__init__.py:1825 ms1.9%
ZipFile.__init__<stdlib>/zipfile/__init__.py:150525 ms1.9%
ZipFile._RealGetContents<stdlib>/zipfile/__init__.py:160613 ms1.0%
8 smaller frames hidden
1 smaller frames hidden
1 smaller frames hidden
2 smaller frames hidden
ClientHandler.__call__django/test/client.py:17313 ms1.0%
BaseHandler.load_middlewaredjango/core/handlers/base.py:6313 ms1.0%
WhiteNoiseMiddleware.__init__whitenoise/middleware.py:10413 ms1.0%
WhiteNoise.add_fileswhitenoise/base.py:10813 ms1.0%
WhiteNoise.update_files_dictionarywhitenoise/base.py:1207 ms0.5%
1 smaller frames hidden
TransactionTestCase._post_teardowndjango/test/testcases.py:1243 self._fixture_teardown()43 ms3.2%
TestCase._fixture_teardowndjango/test/testcases.py:149737 ms2.8%
TestCase._should_check_constraintsdjango/test/testcases.py:150637 ms2.8%
DatabaseWrapper.is_usabledjango/db/backends/postgresql/base.py:50437 ms2.8%
Cursor.executepsycopg/cursor.py:11337 ms2.8%
Connection.waitpsycopg/connection.py:49537 ms2.8%
2 smaller frames hidden
Estimated from 1,367 samples; phase durations are exact. Frames from pytest and pluggy are hidden .

Hot lines in your code

fedidevs/tests.py:63
User.objects.create_user("alice", password="pw")
TestAnonymousCacheAndCsrf.test_authenticated_html_is_private_and_keeps_csrf_header · Password hashing
605 ms
fedidevs/tests.py:64
self.client.login(username="alice", password="pw")
TestAnonymousCacheAndCsrf.test_authenticated_html_is_private_and_keeps_csrf_header · Password hashing
577 ms
confs/views.py:85
if request.user.is_authenticated:
conferences · Database
51 ms
confs/views.py:128
return render(
conferences · Templates
28 ms
fedidevs/tests.py:65
response = self.client.get("/conferences/")
TestAnonymousCacheAndCsrf.test_authenticated_html_is_private_and_keeps_csrf_header · Libraries
13 ms
confs/views.py:41
for al in ConferenceLookup.objects.values("language").annotate(count=Count("language")).order_by("-count")
conferences · Database
4 ms
confs/views.py:107
.annotate(posts_count=Count("conferencepost", filter=Q(conferencepost__created_at__gt=F("posts_after"))))
conferences · Database
0.97 ms

Fixtures

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

Database

31 queries · 48 ms

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

3×
SELECT "confs_conference"."id", "confs_conference"."name", "confs_conference"."slug", "confs_conference"."location", "confs_conference"."start_date", "confs_conference"."end_date", "confs_conference"."time_zone", "confs_conference"."archived_date", "confs_conference"."approved_at", "confs_conferenc…

Biggest pieces of work

call test body
fedidevs/tests.py:63
1.28 s
call _post_teardown
django/test/testcases.py:1243
43 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.32 s c28a326 main Profile
16 hours ago CI github-actions:test passed 650 ms 9b8826a main Profile
22 hours ago CI github-actions:test passed 1.15 s 4f01055 main Profile
1 week, 5 days ago CI github-actions:test passed 1.19 s 8ab642e main Profile
2 weeks, 2 days ago CI github-actions:test passed 720 ms 9b75244 main Profile
2 weeks, 2 days ago CI github-actions:test passed 1.34 s 9603516 main Profile
2 weeks, 4 days ago CI github-actions:test passed 1.02 s 615a272 main Profile
3 weeks ago CI github-actions:test passed 869 ms d923a46 main Profile
3 weeks ago CI github-actions:test passed 2.00 s 82997f8 main Profile
3 weeks ago CI github-actions:test passed 2.12 s 623aa3e main Profile
3 weeks ago CI github-actions:test passed 2.02 s ab6465a main Profile
3 weeks ago CI github-actions:test passed 1.17 s 0c23747 main Run