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

MastodonLoginViewTests::test_create_app_rate_limited_reuses_existing_credentials

First seen 3 months, 3 weeks ago in 553d048
CI github-actions:test 4 runs
Average
135 ms
median 143 ms
max 192 ms
Phases
Setup 2 ms Call 132 ms Teardown 0.29 ms
Categories
Database 8 ms Other (Mocking, pytest, Unsampled, Cache) 126 ms

8 database queries per run

Needs 9 KB of memory (max 16 KB)

Duration per run

Where the time goes

Latest run in ci:github-actions:test, 8 hours ago · open run
Show pytest frames
call57 ms97.3%
MastodonLoginViewTests.test_create_app_rate_limited_reuses_existing_credentialsmastodon_auth/tests.py:145 response = self.client.post("/mastodon_login/", {"instance": "det.social"})53 ms89.0%
Client.postdjango/test/client.py:116253 ms89.0%
RequestFactory.postdjango/test/client.py:49953 ms89.0%
RequestFactory.genericdjango/test/client.py:67153 ms89.0%
Client.requestdjango/test/client.py:109153 ms89.0%
ClientHandler.__call__django/test/client.py:17348 ms80.6%
BaseHandler.load_middlewaredjango/core/handlers/base.py:6348 ms80.6%
WhiteNoiseMiddleware.__init__whitenoise/middleware.py:10448 ms80.6%
WhiteNoise.add_fileswhitenoise/base.py:10848 ms80.6%
WhiteNoise.update_files_dictionarywhitenoise/base.py:12043 ms72.3%
WhiteNoise.add_file_to_dictionarywhitenoise/base.py:13143 ms72.3%
WhiteNoise.get_static_filewhitenoise/base.py:21731 ms52.8%
StaticFile.__init__whitenoise/responders.py:7313 ms22.2%
StaticFile.get_headerswhitenoise/responders.py:17610 ms16.7%
formatdate<stdlib>/email/utils.py:2665 ms8.3%
format_datetime<stdlib>/email/utils.py:2843 ms5.6%
format_datetime<stdlib>/email/utils.py:2752 ms2.8%
Headers.__setitem__<stdlib>/wsgiref/headers.py:632 ms2.8%
StaticFile.get_headerswhitenoise/responders.py:1702 ms2.8%
StaticFile.get_headerswhitenoise/responders.py:1782 ms2.8%
parsedate<stdlib>/email/_parseaddr.py:1852 ms2.8%
format_datetime<stdlib>/email/utils.py:2842 ms2.8%
StaticFile.__init__whitenoise/responders.py:727 ms11.1%
StaticFile.get_file_statswhitenoise/responders.py:1635 ms8.3%
<GC>~5 ms8.3%
StaticFile.get_file_statswhitenoise/responders.py:1612 ms2.8%
__init____init__:-12 ms2.8%
FileEntry.__init__whitenoise/responders.py:2632 ms2.8%
FileEntry.stat_regular_filewhitenoise/responders.py:2742 ms2.8%
StaticFile.__init__whitenoise/responders.py:777 ms11.1%
StaticFile.get_alternativeswhitenoise/responders.py:2013 ms5.6%
StaticFile.get_alternativeswhitenoise/responders.py:2002 ms2.8%
__init____init__:-12 ms2.8%
Headers.__init__<stdlib>/wsgiref/headers.py:442 ms2.8%
Headers._convert_string_type<stdlib>/wsgiref/headers.py:502 ms2.8%
StaticFile.get_alternativeswhitenoise/responders.py:2032 ms2.8%
StaticFile.__init__whitenoise/responders.py:752 ms2.8%
Headers.__getitem__<stdlib>/wsgiref/headers.py:832 ms2.8%
StaticFile.__init__whitenoise/responders.py:762 ms2.8%
StaticFile.get_not_modified_responsewhitenoise/responders.py:1882 ms2.8%
StaticFile.__init__whitenoise/responders.py:742 ms2.8%
parsedate<stdlib>/email/_parseaddr.py:1852 ms2.8%
WhiteNoise.get_static_filewhitenoise/base.py:21210 ms16.7%
WhiteNoise.add_cache_headerswhitenoise/base.py:2338 ms13.9%
WhiteNoiseMiddleware.immutable_file_testwhitenoise/middleware.py:1767 ms11.1%
WhiteNoiseMiddleware.get_static_urlwhitenoise/middleware.py:1977 ms11.1%
LazyObject.__getattribute__django/utils/functional.py:2803 ms5.6%
URLMixin.urldebug_toolbar/panels/staticfiles.py:203 ms5.6%
HashedFilesMixin.urldjango/contrib/staticfiles/storage.py:2352 ms2.8%
HashedFilesMixin._urldjango/contrib/staticfiles/storage.py:2162 ms2.8%
WhiteNoise.add_cache_headerswhitenoise/base.py:2362 ms2.8%
Headers.__setitem__<stdlib>/wsgiref/headers.py:642 ms2.8%
Headers._convert_string_type<stdlib>/wsgiref/headers.py:502 ms2.8%
WhiteNoise.get_static_filewhitenoise/base.py:2142 ms2.8%
Headers.__setitem__<stdlib>/wsgiref/headers.py:622 ms2.8%
Headers.__delitem__<stdlib>/wsgiref/headers.py:712 ms2.8%
Headers._convert_string_type<stdlib>/wsgiref/headers.py:502 ms2.8%
WhiteNoise.update_files_dictionarywhitenoise/base.py:1155 ms8.3%
scantreewhitenoise/base.py:2715 ms8.3%
scantreewhitenoise/base.py:2715 ms8.3%
scantreewhitenoise/base.py:2713 ms5.6%
scantreewhitenoise/base.py:2713 ms5.6%
scantreewhitenoise/base.py:2713 ms5.6%
scantreewhitenoise/base.py:2733 ms5.6%
scantreewhitenoise/base.py:2732 ms2.8%
ClientHandler.__call__django/test/client.py:1865 ms8.3%
BaseHandler.get_responsedjango/core/handlers/base.py:1425 ms8.3%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:565 ms8.3%
MiddlewareMixin.__call__django/utils/deprecation.py:3805 ms8.3%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:565 ms8.3%
MiddlewareMixin.__call__django/utils/deprecation.py:3805 ms8.3%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:565 ms8.3%
MiddlewareMixin.__call__django/utils/deprecation.py:3805 ms8.3%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:565 ms8.3%
WhiteNoiseMiddleware.__call__whitenoise/middleware.py:1235 ms8.3%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:565 ms8.3%
DebugToolbarMiddleware.__call__debug_toolbar/middleware.py:1455 ms8.3%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:565 ms8.3%
MiddlewareMixin.__call__django/utils/deprecation.py:3805 ms8.3%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:565 ms8.3%
MiddlewareMixin.__call__django/utils/deprecation.py:3805 ms8.3%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:565 ms8.3%
MiddlewareMixin.__call__django/utils/deprecation.py:3805 ms8.3%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:565 ms8.3%
MiddlewareMixin.__call__django/utils/deprecation.py:3805 ms8.3%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:565 ms8.3%
MiddlewareMixin.__call__django/utils/deprecation.py:3805 ms8.3%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:565 ms8.3%
MiddlewareMixin.__call__django/utils/deprecation.py:3805 ms8.3%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:565 ms8.3%
MiddlewareMixin.__call__django/utils/deprecation.py:3805 ms8.3%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:565 ms8.3%
BaseHandler._get_responsedjango/core/handlers/base.py:1995 ms8.3%
require_http_methods.<locals>.decorator.<locals>.innerdjango/views/decorators/http.py:635 ms8.3%
loginmastodon_auth/views.py:83 instance = Instance.objects.filter(url=api_base_url).first()2 ms2.8%
QuerySet.firstdjango/db/models/query.py:12122 ms2.8%
QuerySet.__iter__django/db/models/query.py:4392 ms2.8%
QuerySet._fetch_alldjango/db/models/query.py:22622 ms2.8%
ModelIterable.__iter__django/db/models/query.py:1032 ms2.8%
SQLCompiler.execute_sqldjango/db/models/sql/compiler.py:16252 ms2.8%
CursorWrapper.executedjango/db/backends/utils.py:792 ms2.8%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:922 ms2.8%
CursorWrapper._executedjango/db/backends/utils.py:1052 ms2.8%
Cursor.executepsycopg/cursor.py:1132 ms2.8%
Connection.waitpsycopg/connection.py:4952 ms2.8%
BaseCursor._execute_genpsycopg/_cursor_base.py:2062 ms2.8%
BaseCursor._maybe_prepare_genpsycopg/_cursor_base.py:2862 ms2.8%
ClientCursorMixin._execute_sendpsycopg/client_cursor.py:782 ms2.8%
loginmastodon_auth/views.py:162 state = str(uuid4())2 ms2.8%
uuid4<stdlib>/uuid.py:7802 ms2.8%
loginmastodon_auth/views.py:177 cache.set(f"oauth:{state}:next", next_url, timeout=OAUTH_STATE_TTL)2 ms2.8%
FileBasedCache.setdjango/core/cache/backends/filebased.py:562 ms2.8%
_patch.decoration_helper<stdlib>/unittest/mock.py:1418 arg = exit_stack.enter_context(patching)2 ms2.8%
_BaseExitStack.enter_context<stdlib>/contextlib.py:5942 ms2.8%
_patch.__enter__<stdlib>/unittest/mock.py:15682 ms2.8%
NonCallableMock.__new__<stdlib>/unittest/mock.py:4602 ms2.8%
MastodonLoginViewTests.test_create_app_rate_limited_reuses_existing_credentialsmastodon_auth/tests.py:137 instance = Instance.objects.create(2 ms2.8%
BaseManager._get_queryset_methods.<locals>.create_method.<locals>.manager_methoddjango/db/models/manager.py:872 ms2.8%
QuerySet.createdjango/db/models/query.py:7362 ms2.8%
Model.savedjango/db/models/base.py:9042 ms2.8%
Model.save_basedjango/db/models/base.py:9962 ms2.8%
Model._save_tabledjango/db/models/base.py:11992 ms2.8%
Model._do_insertdjango/db/models/base.py:12512 ms2.8%
BaseManager._get_queryset_methods.<locals>.create_method.<locals>.manager_methoddjango/db/models/manager.py:872 ms2.8%
QuerySet._insertdjango/db/models/query.py:21412 ms2.8%
SQLInsertCompiler.execute_sqldjango/db/models/sql/compiler.py:19362 ms2.8%
CursorWrapper.executedjango/db/backends/utils.py:792 ms2.8%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:922 ms2.8%
CursorWrapper._executedjango/db/backends/utils.py:1052 ms2.8%
Cursor.executepsycopg/cursor.py:1132 ms2.8%
Connection.waitpsycopg/connection.py:4952 ms2.8%
BaseCursor._execute_genpsycopg/_cursor_base.py:2062 ms2.8%
BaseCursor._maybe_prepare_genpsycopg/_cursor_base.py:2862 ms2.8%
ClientCursorMixin._execute_sendpsycopg/client_cursor.py:782 ms2.8%
TransactionTestCase._post_teardowndjango/test/testcases.py:1243 self._fixture_teardown()2 ms2.8%
TestCase._fixture_teardowndjango/test/testcases.py:14972 ms2.8%
TestCase._should_check_constraintsdjango/test/testcases.py:15062 ms2.8%
DatabaseWrapper.is_usabledjango/db/backends/postgresql/base.py:5042 ms2.8%
Cursor.executepsycopg/cursor.py:1132 ms2.8%
Connection.waitpsycopg/connection.py:4952 ms2.8%
Estimated from 35 samples; phase durations are exact. Frames from pytest and pluggy are hidden .

Hot lines in your code

mastodon_auth/tests.py:145
response = self.client.post("/mastodon_login/", {"instance": "det.social"})
MastodonLoginViewTests.test_create_app_rate_limited_reuses_existing_credentials · Mocking
48 ms
mastodon_auth/tests.py:137
instance = Instance.objects.create(
MastodonLoginViewTests.test_create_app_rate_limited_reuses_existing_credentials · Database
2 ms
mastodon_auth/views.py:83
instance = Instance.objects.filter(url=api_base_url).first()
login · Database
2 ms
mastodon_auth/views.py:162
state = str(uuid4())
login · Mocking
2 ms
mastodon_auth/views.py:177
cache.set(f"oauth:{state}:next", next_url, timeout=OAUTH_STATE_TTL)
login · Cache
2 ms

Fixtures

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

Database

8 queries · 3 ms
No repeated queries.

Biggest pieces of work

call test body
mastodon_auth/tests.py:145
54 ms
call decoration_helper
<stdlib>/unittest/mock.py:1418
2 ms
call _post_teardown
django/test/testcases.py:1243
2 ms

Reliability

5 results · 0 CI failures · 0 local failures

This test hasn't failed recently.

History

Latest 9 results, oldest first in the strip
When Environment Outcome Duration Commit
8 hours ago CI github-actions:test passed 59 ms d923a46 main Profile
8 hours ago CI github-actions:test passed 116 ms 82997f8 main Profile
8 hours ago CI github-actions:test passed 171 ms 623aa3e main Profile
13 hours ago CI github-actions:test passed 192 ms ab6465a main Profile
13 hours ago CI github-actions:test passed 79 ms 0c23747 main Run
3 months, 3 weeks ago CI github-actions passed 50 ms 69d78ea HEAD Run
3 months, 3 weeks ago CI github-actions passed 70 ms 8fac7b5 main Run
3 months, 3 weeks ago CI github-actions passed 71 ms 36b9579 main Run
3 months, 3 weeks ago CI github-actions passed 84 ms 553d048 main Run