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

MastodonAuthCallbackTests::test_pleroma_granular_scope_mismatch_still_logs_in

First seen 3 months, 4 weeks ago in fcb1b79
CI github-actions:test 4 runs
Average
184 ms
median 210 ms
max 242 ms
Phases
Setup 2 ms Call 182 ms Teardown 0.32 ms
Categories
Database 9 ms Other (Mocking, Cache, pytest, Unsampled) 175 ms

32 database queries per run

Needs 145 KB of memory (max 444 KB)

Duration per run

Where the time goes

Latest run in ci:github-actions:test, 8 hours ago · open run
Hide pytest frames
call73 ms98.6%
CallInfo.from_call_pytest/runner.py:36173 ms98.6%
call_and_report.<locals>.<lambda>_pytest/runner.py:25073 ms98.6%
HookCaller.__call__pluggy/_hooks.py:51273 ms98.6%
PluginManager._hookexecpluggy/_manager.py:12073 ms98.6%
_multicallpluggy/_callers.py:12173 ms98.6%
pytest_runtest_call_pytest/runner.py:18473 ms98.6%
_django_setup_unittest.<locals>.non_debugging_runtestpytest_django/plugin.py:61473 ms98.6%
SimpleTestCase.__call__django/test/testcases.py:31473 ms98.6%
SimpleTestCase._setup_and_calldjango/test/testcases.py:36971 ms96.1%
TestCase.__call__<stdlib>/unittest/case.py:74771 ms96.1%
TestCase.run<stdlib>/unittest/case.py:69171 ms96.1%
TestCase._callTestMethod<stdlib>/unittest/case.py:63771 ms96.1%
_patch.decorate_callable.<locals>.patched<stdlib>/unittest/mock.py:143971 ms96.1%
MastodonAuthCallbackTests.test_pleroma_granular_scope_mismatch_still_logs_inmastodon_auth/tests.py:325 response = self.client.get("/mastodon_auth/", {"code": "abc", "state": state})70 ms93.6%
Client.getdjango/test/client.py:113370 ms93.6%
RequestFactory.getdjango/test/client.py:47570 ms93.6%
RequestFactory.genericdjango/test/client.py:67170 ms93.6%
Client.requestdjango/test/client.py:109170 ms93.6%
ClientHandler.__call__django/test/client.py:17355 ms73.9%
BaseHandler.load_middlewaredjango/core/handlers/base.py:6355 ms73.9%
WhiteNoiseMiddleware.__init__whitenoise/middleware.py:10455 ms73.9%
WhiteNoise.add_fileswhitenoise/base.py:10855 ms73.9%
WhiteNoise.update_files_dictionarywhitenoise/base.py:12042 ms56.7%
WhiteNoise.add_file_to_dictionarywhitenoise/base.py:13138 ms51.8%
WhiteNoise.get_static_filewhitenoise/base.py:21733 ms44.4%
StaticFile.__init__whitenoise/responders.py:7311 ms14.8%
StaticFile.get_headerswhitenoise/responders.py:1765 ms7.4%
formatdate<stdlib>/email/utils.py:2664 ms4.9%
format_datetime<stdlib>/email/utils.py:2772 ms2.5%
format_datetime<stdlib>/email/utils.py:2842 ms2.5%
_format_timetuple_and_zone<stdlib>/email/utils.py:2322 ms2.5%
StaticFile.get_headerswhitenoise/responders.py:1672 ms2.5%
__init____init__:-12 ms2.5%
Headers.__init__<stdlib>/wsgiref/headers.py:432 ms2.5%
Headers._convert_string_type<stdlib>/wsgiref/headers.py:502 ms2.5%
StaticFile.get_headerswhitenoise/responders.py:1772 ms2.5%
Headers.__contains__<stdlib>/wsgiref/headers.py:872 ms2.5%
Headers.get<stdlib>/wsgiref/headers.py:1062 ms2.5%
StaticFile.get_headerswhitenoise/responders.py:1782 ms2.5%
parsedate<stdlib>/email/_parseaddr.py:1852 ms2.5%
parsedate_tz<stdlib>/email/_parseaddr.py:502 ms2.5%
_parsedate_tz<stdlib>/email/_parseaddr.py:1262 ms2.5%
StaticFile.__init__whitenoise/responders.py:7211 ms14.8%
StaticFile.get_file_statswhitenoise/responders.py:16311 ms14.8%
<GC>~11 ms14.8%
StaticFile.__init__whitenoise/responders.py:764 ms4.9%
StaticFile.get_not_modified_responsewhitenoise/responders.py:1894 ms4.9%
Headers.__getitem__<stdlib>/wsgiref/headers.py:834 ms4.9%
Headers.get<stdlib>/wsgiref/headers.py:1064 ms4.9%
StaticFile.__init__whitenoise/responders.py:744 ms4.9%
Headers.__getitem__<stdlib>/wsgiref/headers.py:832 ms2.5%
parsedate<stdlib>/email/_parseaddr.py:1852 ms2.5%
parsedate_tz<stdlib>/email/_parseaddr.py:502 ms2.5%
_parsedate_tz<stdlib>/email/_parseaddr.py:1402 ms2.5%
StaticFile.__init__whitenoise/responders.py:772 ms2.5%
StaticFile.get_alternativeswhitenoise/responders.py:2012 ms2.5%
StaticFile.__init__whitenoise/responders.py:752 ms2.5%
Headers.__getitem__<stdlib>/wsgiref/headers.py:832 ms2.5%
WhiteNoise.get_static_filewhitenoise/base.py:2125 ms7.4%
WhiteNoise.add_cache_headerswhitenoise/base.py:2334 ms4.9%
WhiteNoiseMiddleware.immutable_file_testwhitenoise/middleware.py:1764 ms4.9%
WhiteNoiseMiddleware.get_static_urlwhitenoise/middleware.py:1974 ms4.9%
URLMixin.urldebug_toolbar/panels/staticfiles.py:204 ms4.9%
HashedFilesMixin.urldjango/contrib/staticfiles/storage.py:2352 ms2.5%
HashedFilesMixin._urldjango/contrib/staticfiles/storage.py:2142 ms2.5%
WhiteNoise.add_file_to_dictionarywhitenoise/base.py:1232 ms2.5%
WhiteNoise.is_compressed_variantwhitenoise/base.py:1982 ms2.5%
WhiteNoise.update_files_dictionarywhitenoise/base.py:11513 ms17.3%
scantreewhitenoise/base.py:2719 ms12.3%
scantreewhitenoise/base.py:2715 ms7.4%
scantreewhitenoise/base.py:2734 ms4.9%
scantreewhitenoise/base.py:2702 ms2.5%
scantreewhitenoise/base.py:2734 ms4.9%
scantreewhitenoise/base.py:2734 ms4.9%
ClientHandler.__call__django/test/client.py:18615 ms19.7%
BaseHandler.get_responsedjango/core/handlers/base.py:14215 ms19.7%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5615 ms19.7%
MiddlewareMixin.__call__django/utils/deprecation.py:38015 ms19.7%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5615 ms19.7%
MiddlewareMixin.__call__django/utils/deprecation.py:38015 ms19.7%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5615 ms19.7%
MiddlewareMixin.__call__django/utils/deprecation.py:38015 ms19.7%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5615 ms19.7%
WhiteNoiseMiddleware.__call__whitenoise/middleware.py:12315 ms19.7%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5615 ms19.7%
DebugToolbarMiddleware.__call__debug_toolbar/middleware.py:14515 ms19.7%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5615 ms19.7%
MiddlewareMixin.__call__django/utils/deprecation.py:38013 ms17.3%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5613 ms17.3%
MiddlewareMixin.__call__django/utils/deprecation.py:38013 ms17.3%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5613 ms17.3%
MiddlewareMixin.__call__django/utils/deprecation.py:38013 ms17.3%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5613 ms17.3%
MiddlewareMixin.__call__django/utils/deprecation.py:38013 ms17.3%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5613 ms17.3%
MiddlewareMixin.__call__django/utils/deprecation.py:38013 ms17.3%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5613 ms17.3%
MiddlewareMixin.__call__django/utils/deprecation.py:38013 ms17.3%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5613 ms17.3%
MiddlewareMixin.__call__django/utils/deprecation.py:38013 ms17.3%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5613 ms17.3%
BaseHandler._get_responsedjango/core/handlers/base.py:19913 ms17.3%
authmastodon_auth/views.py:334 account, __ = Account.objects.update_or_create(5 ms7.4%
BaseManager._get_queryset_methods.<locals>.create_method.<locals>.manager_methoddjango/db/models/manager.py:875 ms7.4%
QuerySet.update_or_createdjango/db/models/query.py:10965 ms7.4%
QuerySet.get_or_createdjango/db/models/query.py:10594 ms4.9%
Atomic.__exit__django/db/transaction.py:2594 ms4.9%
async_unsafe.<locals>.decorator.<locals>.innerdjango/utils/asyncio.py:262 ms2.5%
BaseDatabaseWrapper.savepoint_commitdjango/db/backends/base/base.py:4312 ms2.5%
BaseDatabaseWrapper._savepoint_commitdjango/db/backends/base/base.py:3752 ms2.5%
CursorWrapper.executedjango/db/backends/utils.py:792 ms2.5%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:922 ms2.5%
QueryTracker._django_wrapperflakytest/profiling/dbtrack.py:1002 ms2.5%
CursorWrapper._executedjango/db/backends/utils.py:1032 ms2.5%
Cursor.executepsycopg/cursor.py:1132 ms2.5%
Connection.waitpsycopg/connection.py:4952 ms2.5%
BaseCursor._execute_genpsycopg/_cursor_base.py:2062 ms2.5%
BaseCursor._maybe_prepare_genpsycopg/_cursor_base.py:2862 ms2.5%
ClientCursorMixin._execute_sendpsycopg/client_cursor.py:782 ms2.5%
QuerySet.get_or_createdjango/db/models/query.py:10612 ms2.5%
QuerySet.createdjango/db/models/query.py:7362 ms2.5%
Model.savedjango/db/models/base.py:9042 ms2.5%
Model.save_basedjango/db/models/base.py:9962 ms2.5%
Model._save_tabledjango/db/models/base.py:11992 ms2.5%
Model._do_insertdjango/db/models/base.py:12512 ms2.5%
BaseManager._get_queryset_methods.<locals>.create_method.<locals>.manager_methoddjango/db/models/manager.py:872 ms2.5%
QuerySet._insertdjango/db/models/query.py:21412 ms2.5%
SQLInsertCompiler.execute_sqldjango/db/models/sql/compiler.py:19362 ms2.5%
CursorWrapper.executedjango/db/backends/utils.py:792 ms2.5%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:922 ms2.5%
QueryTracker._django_wrapperflakytest/profiling/dbtrack.py:1002 ms2.5%
CursorWrapper._executedjango/db/backends/utils.py:1052 ms2.5%
Cursor.executepsycopg/cursor.py:1132 ms2.5%
Connection.waitpsycopg/connection.py:4952 ms2.5%
BaseCursor._execute_genpsycopg/_cursor_base.py:2062 ms2.5%
BaseCursor._maybe_prepare_genpsycopg/_cursor_base.py:2862 ms2.5%
ClientCursorMixin._execute_sendpsycopg/client_cursor.py:782 ms2.5%
authmastodon_auth/views.py:379 auth_login(request, user, backend=settings.AUTHENTICATION_BACKENDS[0])4 ms4.9%
logindjango/contrib/auth/__init__.py:1892 ms2.5%
SessionBase.cycle_keydjango/contrib/sessions/backends/base.py:4372 ms2.5%
SessionStore.createdjango/contrib/sessions/backends/db.py:742 ms2.5%
SessionStore.savedjango/contrib/sessions/backends/db.py:1262 ms2.5%
Atomic.__enter__django/db/transaction.py:2232 ms2.5%
async_unsafe.<locals>.decorator.<locals>.innerdjango/utils/asyncio.py:262 ms2.5%
BaseDatabaseWrapper.savepointdjango/db/backends/base/base.py:4002 ms2.5%
BaseDatabaseWrapper._savepointdjango/db/backends/base/base.py:3662 ms2.5%
async_unsafe.<locals>.decorator.<locals>.innerdjango/utils/asyncio.py:262 ms2.5%
BaseDatabaseWrapper.cursordjango/db/backends/base/base.py:3202 ms2.5%
BaseDatabaseWrapper._cursordjango/db/backends/base/base.py:2982 ms2.5%
async_unsafe.<locals>.decorator.<locals>.innerdjango/utils/asyncio.py:262 ms2.5%
logindjango/contrib/auth/__init__.py:1982 ms2.5%
Signal.senddjango/dispatch/dispatcher.py:2492 ms2.5%
update_last_logindjango/contrib/auth/models.py:242 ms2.5%
AbstractBaseUser.savedjango/contrib/auth/base_user.py:622 ms2.5%
Model.savedjango/db/models/base.py:9042 ms2.5%
Model.save_basedjango/db/models/base.py:9962 ms2.5%
Model._save_tabledjango/db/models/base.py:11402 ms2.5%
Model._do_updatedjango/db/models/base.py:12442 ms2.5%
QuerySet._updatedjango/db/models/query.py:14482 ms2.5%
SQLUpdateCompiler.execute_returning_sqldjango/db/models/sql/compiler.py:21502 ms2.5%
SQLUpdateCompiler.execute_sqldjango/db/models/sql/compiler.py:21212 ms2.5%
SQLCompiler.execute_sqldjango/db/models/sql/compiler.py:16122 ms2.5%
SQLUpdateCompiler.as_sqldjango/db/models/sql/compiler.py:20982 ms2.5%
SQLCompiler.compiledjango/db/models/sql/compiler.py:5792 ms2.5%
WhereNode.as_sqldjango/db/models/sql/where.py:1512 ms2.5%
SQLCompiler.compiledjango/db/models/sql/compiler.py:5792 ms2.5%
Exact.as_sqldjango/db/models/lookups.py:4072 ms2.5%
BuiltinLookup.as_sqldjango/db/models/lookups.py:2432 ms2.5%
authmastodon_auth/views.py:259 instance = Instance.objects.get(id=instance_id)2 ms2.5%
BaseManager._get_queryset_methods.<locals>.create_method.<locals>.manager_methoddjango/db/models/manager.py:872 ms2.5%
QuerySet.getdjango/db/models/query.py:7022 ms2.5%
QuerySet.__len__django/db/models/query.py:4212 ms2.5%
QuerySet._fetch_alldjango/db/models/query.py:22622 ms2.5%
ModelIterable.__iter__django/db/models/query.py:1032 ms2.5%
SQLCompiler.execute_sqldjango/db/models/sql/compiler.py:16252 ms2.5%
CursorWrapper.executedjango/db/backends/utils.py:792 ms2.5%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:922 ms2.5%
QueryTracker._django_wrapperflakytest/profiling/dbtrack.py:1002 ms2.5%
CursorWrapper._executedjango/db/backends/utils.py:1052 ms2.5%
Cursor.executepsycopg/cursor.py:1132 ms2.5%
Connection.waitpsycopg/connection.py:4952 ms2.5%
BaseCursor._execute_genpsycopg/_cursor_base.py:2062 ms2.5%
BaseCursor._maybe_prepare_genpsycopg/_cursor_base.py:2862 ms2.5%
ClientCursorMixin._execute_sendpsycopg/client_cursor.py:782 ms2.5%
authmastodon_auth/views.py:368 user, __ = User.objects.get_or_create(username=account.username_at_instance)2 ms2.5%
BaseManager._get_queryset_methods.<locals>.create_method.<locals>.manager_methoddjango/db/models/manager.py:872 ms2.5%
QuerySet.get_or_createdjango/db/models/query.py:10592 ms2.5%
Atomic.__enter__django/db/transaction.py:2232 ms2.5%
async_unsafe.<locals>.decorator.<locals>.innerdjango/utils/asyncio.py:262 ms2.5%
BaseDatabaseWrapper.savepointdjango/db/backends/base/base.py:4002 ms2.5%
BaseDatabaseWrapper._savepointdjango/db/backends/base/base.py:3672 ms2.5%
CursorWrapper.executedjango/db/backends/utils.py:792 ms2.5%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:922 ms2.5%
QueryTracker._django_wrapperflakytest/profiling/dbtrack.py:1002 ms2.5%
CursorWrapper._executedjango/db/backends/utils.py:1032 ms2.5%
Cursor.executepsycopg/cursor.py:1132 ms2.5%
Connection.waitpsycopg/connection.py:4952 ms2.5%
BaseCursor._execute_genpsycopg/_cursor_base.py:2062 ms2.5%
BaseCursor._maybe_prepare_genpsycopg/_cursor_base.py:2862 ms2.5%
ClientCursorMixin._execute_sendpsycopg/client_cursor.py:782 ms2.5%
MiddlewareMixin.__call__django/utils/deprecation.py:3822 ms2.5%
SessionMiddleware.process_responsedjango/contrib/sessions/middleware.py:602 ms2.5%
SessionStore.savedjango/contrib/sessions/backends/db.py:1262 ms2.5%
Atomic.__enter__django/db/transaction.py:2232 ms2.5%
async_unsafe.<locals>.decorator.<locals>.innerdjango/utils/asyncio.py:262 ms2.5%
BaseDatabaseWrapper.savepointdjango/db/backends/base/base.py:4002 ms2.5%
BaseDatabaseWrapper._savepointdjango/db/backends/base/base.py:3672 ms2.5%
CursorWrapper.executedjango/db/backends/utils.py:792 ms2.5%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:922 ms2.5%
QueryTracker._django_wrapperflakytest/profiling/dbtrack.py:1002 ms2.5%
CursorWrapper._executedjango/db/backends/utils.py:1032 ms2.5%
Cursor.executepsycopg/cursor.py:1132 ms2.5%
Connection.waitpsycopg/connection.py:4952 ms2.5%
BaseCursor._execute_genpsycopg/_cursor_base.py:2062 ms2.5%
BaseCursor._maybe_prepare_genpsycopg/_cursor_base.py:2862 ms2.5%
ClientCursorMixin._execute_sendpsycopg/client_cursor.py:782 ms2.5%
MastodonAuthCallbackTests.test_pleroma_granular_scope_mismatch_still_logs_inmastodon_auth/tests.py:3242 ms2.5%
_GeneratorContextManager.__exit__<stdlib>/contextlib.py:2102 ms2.5%
TestCase.captureOnCommitCallbacksdjango/test/testcases.py:15362 ms2.5%
auth.<locals>.<lambda>mastodon_auth/views.py:381 transaction.on_commit(lambda: sync_following.delay(user.id))2 ms2.5%
NonCallableMock.__getattr__<stdlib>/unittest/mock.py:7172 ms2.5%
SimpleTestCase._setup_and_calldjango/test/testcases.py:3722 ms2.5%
TransactionTestCase._post_teardowndjango/test/testcases.py:1243 self._fixture_teardown()2 ms2.5%
TestCase._fixture_teardowndjango/test/testcases.py:14982 ms2.5%
DatabaseWrapper.check_constraintsdjango/db/backends/postgresql/base.py:4962 ms2.5%
CursorWrapper.executedjango/db/backends/utils.py:792 ms2.5%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:922 ms2.5%
QueryTracker._django_wrapperflakytest/profiling/dbtrack.py:1002 ms2.5%
CursorWrapper._executedjango/db/backends/utils.py:1032 ms2.5%
Cursor.executepsycopg/cursor.py:1132 ms2.5%
Connection.waitpsycopg/connection.py:4952 ms2.5%
BaseCursor._execute_genpsycopg/_cursor_base.py:2062 ms2.5%
BaseCursor._maybe_prepare_genpsycopg/_cursor_base.py:2862 ms2.5%
ClientCursorMixin._execute_sendpsycopg/client_cursor.py:782 ms2.5%
Estimated from 40 samples; phase durations are exact. Frames from pytest and pluggy are shown .

Hot lines in your code

mastodon_auth/tests.py:325
response = self.client.get("/mastodon_auth/", {"code": "abc", "state": state})
MastodonAuthCallbackTests.test_pleroma_granular_scope_mismatch_still_logs_in · Mocking
57 ms
mastodon_auth/views.py:334
account, __ = Account.objects.update_or_create(
auth · Database
5 ms
mastodon_auth/views.py:379
auth_login(request, user, backend=settings.AUTHENTICATION_BACKENDS[0])
auth · Database
4 ms
mastodon_auth/views.py:259
instance = Instance.objects.get(id=instance_id)
auth · Database
2 ms
mastodon_auth/views.py:368
user, __ = User.objects.get_or_create(username=account.username_at_instance)
auth · Database
2 ms
mastodon_auth/views.py:381
transaction.on_commit(lambda: sync_following.delay(user.id))
auth.<locals>.<lambda> · Mocking
2 ms

Fixtures

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

Database

32 queries · 8 ms
No repeated queries.

Biggest pieces of work

call test body
mastodon_auth/tests.py:325
71 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 18 results, oldest first in the strip
When Environment Outcome Duration Commit
8 hours ago CI github-actions:test passed 74 ms d923a46 main Profile
8 hours ago CI github-actions:test passed 204 ms 82997f8 main Profile
9 hours ago CI github-actions:test passed 216 ms 623aa3e main Profile
13 hours ago CI github-actions:test passed 242 ms ab6465a main Profile
14 hours ago CI github-actions:test passed 97 ms 0c23747 main Run
3 months, 3 weeks ago CI github-actions passed 65 ms 69d78ea HEAD Run
3 months, 3 weeks ago CI github-actions passed 91 ms 8fac7b5 main Run
3 months, 3 weeks ago CI github-actions passed 89 ms 36b9579 main Run
3 months, 3 weeks ago CI github-actions passed 121 ms 553d048 main Run
3 months, 3 weeks ago CI github-actions passed 87 ms 8eb0f44 HEAD Run
3 months, 3 weeks ago CI github-actions passed 102 ms e0fb3ac HEAD Run
3 months, 3 weeks ago CI github-actions passed 86 ms a849b58 HEAD Run
3 months, 3 weeks ago CI github-actions passed 97 ms 6418e05 HEAD Run
3 months, 3 weeks ago CI github-actions passed 103 ms 5b9b309 main Run
3 months, 4 weeks ago CI github-actions passed 103 ms 1f2c5a6 main Run
3 months, 4 weeks ago CI github-actions passed 101 ms 5ec7fa8 main Run
3 months, 4 weeks ago CI github-actions passed 99 ms 1e42064 main Run
3 months, 4 weeks ago CI github-actions passed 93 ms fcb1b79 main Run