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

UnsubscribeTest::test_signed_links

First seen 3 weeks ago in 78a4357
CI github-actions:test 12 runs
Average
58 ms
median 65 ms
max 75 ms
Phases
Setup 10 ms Call 47 ms Teardown 0.96 ms
Categories
Database 28 ms Password hashing 0.15 ms Other (Libraries, pytest, Templates, Unsampled, ...) 30 ms

17 database queries per run

Needs 400 KB of memory (max 776 KB)

Duration per run

Where the time goes

Latest run in ci:github-actions:test, 16 hours ago · open run
Show pytest frames
setup9 ms13.7%
TestCase.setUpClassdjango/test/testcases.py:1423 cls.cls_atomics = cls._enter_atomics()9 ms13.7%
TestCase._enter_atomicsdjango/test/testcases.py:13969 ms13.7%
Atomic.__enter__django/db/transaction.py:1989 ms13.7%
BaseDatabaseWrapper.get_autocommitdjango/db/backends/base/base.py:4549 ms13.7%
SimpleTestCase.ensure_connection_patch_method.<locals>.patched_ensure_connectiondjango/test/testcases.py:3039 ms13.7%
async_unsafe.<locals>.decorator.<locals>.innerdjango/utils/asyncio.py:269 ms13.7%
BaseDatabaseWrapper.ensure_connectiondjango/db/backends/base/base.py:2799 ms13.7%
async_unsafe.<locals>.decorator.<locals>.innerdjango/utils/asyncio.py:269 ms13.7%
BaseDatabaseWrapper.connectdjango/db/backends/base/base.py:2568 ms12.3%
async_unsafe.<locals>.decorator.<locals>.innerdjango/utils/asyncio.py:268 ms12.3%
DatabaseWrapper.get_new_connectiondjango/db/backends/postgresql/base.py:3338 ms12.3%
Connection.connectpsycopg/connection.py:1098 ms12.3%
wait_connpsycopg/waiting.py:1414 ms5.5%
EpollSelector.select<stdlib>/selectors.py:4524 ms5.5%
wait_connpsycopg/waiting.py:1454 ms5.5%
BaseConnection._connect_genpsycopg/_connection_base.py:4394 ms5.5%
wait_connpsycopg/waiting.py:1480.93 ms1.4%
_PollLikeSelector.register<stdlib>/selectors.py:3450.93 ms1.4%
BaseDatabaseWrapper.connectdjango/db/backends/base/base.py:2590.93 ms1.4%
Signal.senddjango/dispatch/dispatcher.py:2070.93 ms1.4%
call58 ms85.5%
UnsubscribeTest.test_signed_linksft/tests.py:133 self.assertContains(self.client.get(url), "You are unsubscribed")26 ms38.0%
Client.getdjango/test/client.py:112426 ms38.0%
RequestFactory.getdjango/test/client.py:47526 ms38.0%
RequestFactory.genericdjango/test/client.py:67126 ms38.0%
Client.requestdjango/test/client.py:108226 ms38.0%
ClientHandler.__call__django/test/client.py:17326 ms38.0%
BaseHandler.load_middlewaredjango/core/handlers/base.py:6226 ms38.0%
WhiteNoiseMiddleware.__init__whitenoise/middleware.py:10426 ms38.0%
WhiteNoise.add_fileswhitenoise/base.py:10826 ms38.0%
WhiteNoise.update_files_dictionarywhitenoise/base.py:12024 ms34.8%
WhiteNoise.add_file_to_dictionarywhitenoise/base.py:13124 ms34.8%
WhiteNoise.get_static_filewhitenoise/base.py:20815 ms22.2%
StaticFile.__init__whitenoise/responders.py:7311 ms15.8%
StaticFile.get_headerswhitenoise/responders.py:1676 ms9.5%
StaticFile.get_headerswhitenoise/responders.py:1782 ms3.2%
parsedate<stdlib>/email/_parseaddr.py:1852 ms3.2%
parsedate_tz<stdlib>/email/_parseaddr.py:502 ms3.2%
_parsedate_tz<stdlib>/email/_parseaddr.py:1412 ms3.2%
StaticFile.get_headerswhitenoise/responders.py:1812 ms3.2%
StaticFile.__init__whitenoise/responders.py:762 ms3.2%
StaticFile.get_not_modified_responsewhitenoise/responders.py:1892 ms3.2%
Headers.__getitem__<stdlib>/wsgiref/headers.py:832 ms3.2%
Headers.get<stdlib>/wsgiref/headers.py:1062 ms3.2%
WhiteNoise.get_static_filewhitenoise/base.py:2024 ms6.3%
WhiteNoise.add_mime_headerswhitenoise/base.py:2212 ms3.2%
Headers.add_header<stdlib>/wsgiref/headers.py:1852 ms3.2%
WhiteNoise.get_static_filewhitenoise/base.py:2034 ms6.3%
WhiteNoise.add_cache_headerswhitenoise/base.py:2244 ms6.3%
WhiteNoiseMiddleware.immutable_file_testwhitenoise/middleware.py:1764 ms6.3%
WhiteNoiseMiddleware.get_static_urlwhitenoise/middleware.py:1974 ms6.3%
URLMixin.urldebug_toolbar/panels/staticfiles.py:204 ms6.3%
HashedFilesMixin.urldjango/contrib/staticfiles/storage.py:2054 ms6.3%
HashedFilesMixin._urldjango/contrib/staticfiles/storage.py:1842 ms3.2%
WhiteNoise.update_files_dictionarywhitenoise/base.py:1152 ms3.2%
scantreewhitenoise/base.py:2622 ms3.2%
scantreewhitenoise/base.py:2622 ms3.2%
scantreewhitenoise/base.py:2622 ms3.2%
scantreewhitenoise/base.py:2622 ms3.2%
scantreewhitenoise/base.py:2622 ms3.2%
scantreewhitenoise/base.py:2642 ms3.2%
UnsubscribeTest.test_signed_linksft/tests.py:138 self.assertEqual(self.client.post(reverse("unsubscribe", args=[str(user.pk)])).status_code, 404)11 ms15.8%
Client.postdjango/test/client.py:11539 ms12.7%
RequestFactory.postdjango/test/client.py:4999 ms12.7%
RequestFactory.genericdjango/test/client.py:6719 ms12.7%
Client.requestdjango/test/client.py:10829 ms12.7%
ClientHandler.__call__django/test/client.py:1866 ms9.5%
BaseHandler.get_responsedjango/core/handlers/base.py:1416 ms9.5%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:556 ms9.5%
DebugToolbarMiddleware.__call__debug_toolbar/middleware.py:1306 ms9.5%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:556 ms9.5%
MiddlewareMixin.__call__django/utils/deprecation.py:3096 ms9.5%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:556 ms9.5%
WhiteNoiseMiddleware.__call__whitenoise/middleware.py:1236 ms9.5%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:556 ms9.5%
MiddlewareMixin.__call__django/utils/deprecation.py:3096 ms9.5%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:556 ms9.5%
MiddlewareMixin.__call__django/utils/deprecation.py:3096 ms9.5%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:556 ms9.5%
MiddlewareMixin.__call__django/utils/deprecation.py:3094 ms6.3%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:554 ms6.3%
MiddlewareMixin.__call__django/utils/deprecation.py:3094 ms6.3%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:554 ms6.3%
MiddlewareMixin.__call__django/utils/deprecation.py:3094 ms6.3%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:554 ms6.3%
MiddlewareMixin.__call__django/utils/deprecation.py:3094 ms6.3%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:554 ms6.3%
AccountMiddleware.<locals>.middlewareallauth/account/middleware.py:342 ms3.2%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:552 ms3.2%
BaseHandler._get_responsedjango/core/handlers/base.py:2002 ms3.2%
BaseHandler.process_exception_by_middlewaredjango/core/handlers/base.py:3632 ms3.2%
AccountMiddleware.<locals>.middlewareallauth/account/middleware.py:352 ms3.2%
_should_redirect_accountsallauth/account/middleware.py:672 ms3.2%
reversedjango/urls/base.py:982 ms3.2%
URLResolver._reverse_with_prefixdjango/urls/resolvers.py:8032 ms3.2%
search<stdlib>/re/__init__.py:1792 ms3.2%
MiddlewareMixin.__call__django/utils/deprecation.py:3082 ms3.2%
CsrfViewMiddleware.process_requestdjango/middleware/csrf.py:4032 ms3.2%
CsrfViewMiddleware._get_secretdjango/middleware/csrf.py:2452 ms3.2%
ClientHandler.__call__django/test/client.py:1782 ms3.2%
__init____init__:-12 ms3.2%
WSGIRequest.__init__django/core/handlers/wsgi.py:732 ms3.2%
reversedjango/urls/base.py:982 ms3.2%
URLResolver._reverse_with_prefixdjango/urls/resolvers.py:8052 ms3.2%
UnsubscribeTest.test_signed_linksft/tests.py:139 self.assertFalse(Unsubscribe.objects.exists())11 ms15.8%
BaseManager._get_queryset_methods.<locals>.create_method.<locals>.manager_methoddjango/db/models/manager.py:879 ms12.7%
QuerySet.existsdjango/db/models/query.py:13379 ms12.7%
Query.has_resultsdjango/db/models/sql/query.py:6816 ms9.5%
SQLCompiler.has_resultsdjango/db/models/sql/compiler.py:15926 ms9.5%
SQLCompiler.execute_sqldjango/db/models/sql/compiler.py:16244 ms6.3%
CursorWrapper.executedjango/db/backends/utils.py:794 ms6.3%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:924 ms6.3%
CursorWrapper._executedjango/db/backends/utils.py:1054 ms6.3%
Cursor.executepsycopg/cursor.py:1134 ms6.3%
Connection.waitpsycopg/connection.py:4954 ms6.3%
BaseCursor._execute_genpsycopg/_cursor_base.py:2062 ms3.2%
BaseCursor._maybe_prepare_genpsycopg/_cursor_base.py:2862 ms3.2%
ClientCursorMixin._execute_sendpsycopg/client_cursor.py:782 ms3.2%
SQLCompiler.execute_sqldjango/db/models/sql/compiler.py:16112 ms3.2%
SQLCompiler.as_sqldjango/db/models/sql/compiler.py:7672 ms3.2%
SQLCompiler.pre_sql_setupdjango/db/models/sql/compiler.py:862 ms3.2%
SQLCompiler.setup_querydjango/db/models/sql/compiler.py:752 ms3.2%
cached_property.__get__django/utils/functional.py:472 ms3.2%
BaseExpression.output_fielddjango/db/models/expressions.py:3282 ms3.2%
Value._resolve_output_fielddjango/db/models/expressions.py:12012 ms3.2%
Field.__init__django/db/models/fields/__init__.py:2282 ms3.2%
Field.choicesdjango/db/models/fields/__init__.py:5542 ms3.2%
normalize_choicesdjango/utils/choices.py:1002 ms3.2%
Query.has_resultsdjango/db/models/sql/query.py:6792 ms3.2%
Query.existsdjango/db/models/sql/query.py:6752 ms3.2%
BaseManager._get_queryset_methods.<locals>.create_method.<locals>.manager_methoddjango/db/models/manager.py:-12 ms3.2%
UnsubscribeTest.test_signed_linksft/tests.py:137 self.assertFalse(Unsubscribe.objects.filter(user=user).exists())4 ms6.3%
QuerySet.existsdjango/db/models/query.py:13374 ms6.3%
Query.has_resultsdjango/db/models/sql/query.py:6814 ms6.3%
SQLCompiler.has_resultsdjango/db/models/sql/compiler.py:15924 ms6.3%
SQLCompiler.execute_sqldjango/db/models/sql/compiler.py:16244 ms6.3%
CursorWrapper.executedjango/db/backends/utils.py:794 ms6.3%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:924 ms6.3%
CursorWrapper._executedjango/db/backends/utils.py:1052 ms3.2%
Cursor.executepsycopg/cursor.py:1132 ms3.2%
Connection.waitpsycopg/connection.py:4952 ms3.2%
TransactionTestCase._pre_setupdjango/test/testcases.py:1164 cls._fixture_setup()2 ms3.2%
TestCase._fixture_setupdjango/test/testcases.py:14782 ms3.2%
TestCase._enter_atomicsdjango/test/testcases.py:13962 ms3.2%
Atomic.__enter__django/db/transaction.py:2112 ms3.2%
async_unsafe.<locals>.decorator.<locals>.innerdjango/utils/asyncio.py:262 ms3.2%
BaseDatabaseWrapper.savepointdjango/db/backends/base/base.py:4002 ms3.2%
BaseDatabaseWrapper._savepointdjango/db/backends/base/base.py:3672 ms3.2%
CursorWrapper.executedjango/db/backends/utils.py:792 ms3.2%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:922 ms3.2%
CursorWrapper._executedjango/db/backends/utils.py:1032 ms3.2%
Cursor.executepsycopg/cursor.py:1132 ms3.2%
Connection.waitpsycopg/connection.py:4952 ms3.2%
UnsubscribeTest.test_signed_linksft/tests.py:131 user = User.objects.create_user("ada", email="[email protected]")2 ms3.2%
UserManager.create_userdjango/contrib/auth/models.py:1752 ms3.2%
UserManager._create_userdjango/contrib/auth/models.py:1632 ms3.2%
AbstractBaseUser.savedjango/contrib/auth/base_user.py:622 ms3.2%
Model.savedjango/db/models/base.py:8742 ms3.2%
Model.save_basedjango/db/models/base.py:9662 ms3.2%
Model._save_tabledjango/db/models/base.py:11672 ms3.2%
Model._do_insertdjango/db/models/base.py:12182 ms3.2%
BaseManager._get_queryset_methods.<locals>.create_method.<locals>.manager_methoddjango/db/models/manager.py:872 ms3.2%
QuerySet._insertdjango/db/models/query.py:19182 ms3.2%
SQLInsertCompiler.execute_sqldjango/db/models/sql/compiler.py:19252 ms3.2%
CursorWrapper.executedjango/db/backends/utils.py:792 ms3.2%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:922 ms3.2%
CursorWrapper._executedjango/db/backends/utils.py:1052 ms3.2%
Cursor.executepsycopg/cursor.py:1132 ms3.2%
Connection.waitpsycopg/connection.py:4952 ms3.2%
TransactionTestCase._post_teardowndjango/test/testcases.py:1240 self._fixture_teardown()2 ms3.2%
TestCase._fixture_teardowndjango/test/testcases.py:14902 ms3.2%
TestCase._databases_support_transactionsdjango/test/testcases.py:14092 ms3.2%
Estimated from 37 samples; phase durations are exact. Frames from pytest and pluggy are hidden .

Hot lines in your code

ft/tests.py:133
self.assertContains(self.client.get(url), "You are unsubscribed")
UnsubscribeTest.test_signed_links · Libraries
26 ms
ft/tests.py:138
self.assertEqual(self.client.post(reverse("unsubscribe", args=[str(user.pk)])).status_code, 404)
UnsubscribeTest.test_signed_links · Libraries
11 ms
ft/tests.py:139
self.assertFalse(Unsubscribe.objects.exists())
UnsubscribeTest.test_signed_links · Database
11 ms
ft/tests.py:137
self.assertFalse(Unsubscribe.objects.filter(user=user).exists())
UnsubscribeTest.test_signed_links · Database
4 ms
ft/tests.py:131
user = User.objects.create_user("ada", email="[email protected]")
UnsubscribeTest.test_signed_links · Database
2 ms

Fixtures

Exact setup time
_unittest_setUpClass_fixture_UnsubscribeTest class 8 ms
_django_setup_unittest class 0.27 ms
monkeypatch function 0.04 ms
_dj_autoclear_mailbox function 0.04 ms
_template_string_if_invalid_marker function 0.04 ms
_django_db_marker function 0.03 ms
_live_server_helper function 0.03 ms
_django_set_urlconf function 0.03 ms
_django_clear_site_cache function 0.03 ms

Database

17 queries · 8 ms

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

3×
SELECT "auth_user"."id", "auth_user"."password", "auth_user"."last_login", "auth_user"."is_superuser", "auth_user"."username", "auth_user"."first_name", "auth_user"."last_name", "auth_user"."email", "auth_user"."is_staff", "auth_user"."is_active", "auth_user"."date_joined" FROM "auth_user" WHERE "a…

Biggest pieces of work

call test body
ft/tests.py:133
54 ms
setup setUpClass
django/test/testcases.py:1423
9 ms
call _pre_setup
django/test/testcases.py:1164
2 ms
call _post_teardown
django/test/testcases.py:1240
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
16 hours ago CI github-actions:test passed 68 ms e141198 main Profile
1 week, 5 days ago CI github-actions:test passed 29 ms 46ec2aa main Profile
2 weeks, 1 day ago CI github-actions:test passed 66 ms afde85b main Profile
2 weeks, 1 day ago CI github-actions:test passed 50 ms fe29f9d main Profile
2 weeks, 1 day ago CI github-actions:test passed 75 ms 044719a main Profile
2 weeks, 2 days ago CI github-actions:test passed 35 ms b3fedae main Profile
2 weeks, 4 days ago CI github-actions:test passed 65 ms 43c4eda main Profile
2 weeks, 6 days ago CI github-actions:test passed 66 ms 9caa567 main Profile
2 weeks, 6 days ago CI github-actions:test passed 62 ms ec75501 main Profile
3 weeks ago CI github-actions:test passed 71 ms d2c12e5 main Profile
3 weeks ago CI github-actions:test passed 34 ms 0b902f6 main Profile
3 weeks ago CI github-actions:test passed 70 ms 78a4357 main Profile