flakytest.dev anze3db flakytest
Tests / apps/api/tests.py

ProfileUploadTest::test_reject_invalid_json

First seen 9 hours ago in 78a4357
CI github-actions:test 5 runs
Average
37 ms
median 41 ms
max 45 ms
Phases
Setup 0.71 ms Call 36 ms Teardown 0.16 ms
Categories
Database 6 ms Other (Libraries, Unsampled, pytest) 31 ms

10 database queries per run

Needs 250 KB of memory (max 592 KB)

Duration per run

Where the time goes

Latest run in ci:github-actions:test, 2 hours ago · open run
Hide pytest frames
setup0.77 ms1.7%
call44 ms97.8%
CallInfo.from_call_pytest/runner.py:35344 ms97.8%
call_and_report.<locals>.<lambda>_pytest/runner.py:24544 ms97.8%
HookCaller.__call__pluggy/_hooks.py:51244 ms97.8%
PluginManager._hookexecpluggy/_manager.py:12044 ms97.8%
_multicallpluggy/_callers.py:12144 ms97.8%
pytest_runtest_call_pytest/runner.py:17944 ms97.8%
_django_setup_unittest.<locals>.non_debugging_runtestpytest_django/plugin.py:57344 ms97.8%
SimpleTestCase.__call__django/test/testcases.py:31344 ms97.8%
SimpleTestCase._setup_and_calldjango/test/testcases.py:36841 ms91.7%
TestCase.__call__<stdlib>/unittest/case.py:74741 ms91.7%
TestCase.run<stdlib>/unittest/case.py:69141 ms91.7%
TestCase._callTestMethod<stdlib>/unittest/case.py:63741 ms91.7%
ProfileUploadTest.test_reject_invalid_jsonapps/api/tests.py:600 response = self.upload(b"{nope")41 ms91.7%
ProfileUploadTest.uploadapps/api/tests.py:487 response = self.client.post(41 ms91.7%
Client.postdjango/test/client.py:115341 ms91.7%
RequestFactory.postdjango/test/client.py:49941 ms91.7%
RequestFactory.genericdjango/test/client.py:67141 ms91.7%
Client.requestdjango/test/client.py:108241 ms91.7%
ClientHandler.__call__django/test/client.py:17333 ms73.4%
BaseHandler.load_middlewaredjango/core/handlers/base.py:6233 ms73.4%
WhiteNoiseMiddleware.__init__whitenoise/middleware.py:10433 ms73.4%
WhiteNoise.add_fileswhitenoise/base.py:10833 ms73.4%
WhiteNoise.update_files_dictionarywhitenoise/base.py:12027 ms61.1%
WhiteNoise.add_file_to_dictionarywhitenoise/base.py:13127 ms61.1%
WhiteNoise.get_static_filewhitenoise/base.py:20816 ms36.7%
StaticFile.__init__whitenoise/responders.py:7211 ms24.5%
StaticFile.get_file_statswhitenoise/responders.py:16111 ms24.5%
__init____init__:-18 ms18.3%
FileEntry.__init__whitenoise/responders.py:2608 ms18.3%
<GC>~8 ms18.3%
StaticFile.__init__whitenoise/responders.py:763 ms6.1%
StaticFile.get_not_modified_responsewhitenoise/responders.py:1883 ms6.1%
Headers.__contains__<stdlib>/wsgiref/headers.py:873 ms6.1%
Headers.get<stdlib>/wsgiref/headers.py:1053 ms6.1%
StaticFile.__init__whitenoise/responders.py:733 ms6.1%
StaticFile.get_headerswhitenoise/responders.py:1713 ms6.1%
WhiteNoise.get_static_filewhitenoise/base.py:2033 ms6.1%
WhiteNoise.add_cache_headerswhitenoise/base.py:2243 ms6.1%
WhiteNoiseMiddleware.immutable_file_testwhitenoise/middleware.py:1763 ms6.1%
WhiteNoiseMiddleware.get_static_urlwhitenoise/middleware.py:1973 ms6.1%
URLMixin.urldebug_toolbar/panels/staticfiles.py:203 ms6.1%
HashedFilesMixin.urldjango/contrib/staticfiles/storage.py:2053 ms6.1%
HashedFilesMixin._urldjango/contrib/staticfiles/storage.py:1843 ms6.1%
WhiteNoise.update_files_dictionarywhitenoise/base.py:1155 ms12.2%
scantreewhitenoise/base.py:2625 ms12.2%
scantreewhitenoise/base.py:2625 ms12.2%
scantreewhitenoise/base.py:2643 ms6.1%
scantreewhitenoise/base.py:2603 ms6.1%
ClientHandler.__call__django/test/client.py:1868 ms18.3%
BaseHandler.get_responsedjango/core/handlers/base.py:1418 ms18.3%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:558 ms18.3%
DebugToolbarMiddleware.__call__debug_toolbar/middleware.py:1308 ms18.3%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:558 ms18.3%
MiddlewareMixin.__call__django/utils/deprecation.py:3098 ms18.3%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:558 ms18.3%
WhiteNoiseMiddleware.__call__whitenoise/middleware.py:1238 ms18.3%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:558 ms18.3%
MiddlewareMixin.__call__django/utils/deprecation.py:3098 ms18.3%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:558 ms18.3%
MiddlewareMixin.__call__django/utils/deprecation.py:3098 ms18.3%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:558 ms18.3%
MiddlewareMixin.__call__django/utils/deprecation.py:3098 ms18.3%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:558 ms18.3%
MiddlewareMixin.__call__django/utils/deprecation.py:3098 ms18.3%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:558 ms18.3%
MiddlewareMixin.__call__django/utils/deprecation.py:3098 ms18.3%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:558 ms18.3%
MiddlewareMixin.__call__django/utils/deprecation.py:3098 ms18.3%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:558 ms18.3%
AccountMiddleware.<locals>.middlewareallauth/account/middleware.py:348 ms18.3%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:558 ms18.3%
BaseHandler._get_responsedjango/core/handlers/base.py:1988 ms18.3%
csrf_exempt.<locals>._view_wrapperdjango/views/decorators/csrf.py:658 ms18.3%
jsonify_errors.<locals>.wrapped_viewapps/api/urls.py:378 ms18.3%
require_http_methods.<locals>.decorator.<locals>.innerdjango/views/decorators/http.py:648 ms18.3%
api_request.<locals>.decorator.<locals>.wrapped_viewapps/api/urls.py:73 touch_token(request.headers.get("Authorization"))5 ms12.2%
ContextDecorator.__call__.<locals>.inner<stdlib>/contextlib.py:1165 ms12.2%
touch_tokenapps/api/urls.py:59 SecretTokens.objects.filter(pk__in=list(stale)).update(date_last_used=now)5 ms12.2%
QuerySet.__iter__django/db/models/query.py:3903 ms6.1%
QuerySet._fetch_alldjango/db/models/query.py:20003 ms6.1%
FlatValuesListIterable.__iter__django/db/models/query.py:2773 ms6.1%
SQLCompiler.results_iterdjango/db/models/sql/compiler.py:15733 ms6.1%
SQLCompiler.execute_sqldjango/db/models/sql/compiler.py:16113 ms6.1%
SQLCompiler.as_sqldjango/db/models/sql/compiler.py:7673 ms6.1%
SQLCompiler.pre_sql_setupdjango/db/models/sql/compiler.py:863 ms6.1%
SQLCompiler.setup_querydjango/db/models/sql/compiler.py:753 ms6.1%
SQLCompiler.get_selectdjango/db/models/sql/compiler.py:3173 ms6.1%
QuerySet.updatedjango/db/models/query.py:13003 ms6.1%
SQLUpdateCompiler.execute_sqldjango/db/models/sql/compiler.py:21113 ms6.1%
SQLCompiler.execute_sqldjango/db/models/sql/compiler.py:16243 ms6.1%
CursorWrapper.executedjango/db/backends/utils.py:793 ms6.1%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:923 ms6.1%
QueryTracker._django_wrapperflakytest/profiling/dbtrack.py:1003 ms6.1%
CursorWrapper._executedjango/db/backends/utils.py:1053 ms6.1%
Cursor.executepsycopg/cursor.py:1133 ms6.1%
Connection.waitpsycopg/connection.py:4953 ms6.1%
BaseCursor._execute_genpsycopg/_cursor_base.py:2063 ms6.1%
BaseCursor._maybe_prepare_genpsycopg/_cursor_base.py:2863 ms6.1%
ClientCursorMixin._execute_sendpsycopg/client_cursor.py:783 ms6.1%
api_request.<locals>.decorator.<locals>.wrapped_viewapps/api/urls.py:72 project = get_object_or_404(Project, secrettokens__token=request.headers.get("Authorization"))3 ms6.1%
get_object_or_404django/shortcuts.py:903 ms6.1%
QuerySet.getdjango/db/models/query.py:6353 ms6.1%
QuerySet.__len__django/db/models/query.py:3723 ms6.1%
QuerySet._fetch_alldjango/db/models/query.py:20003 ms6.1%
ModelIterable.__iter__django/db/models/query.py:953 ms6.1%
SQLCompiler.execute_sqldjango/db/models/sql/compiler.py:16243 ms6.1%
CursorWrapper.executedjango/db/backends/utils.py:793 ms6.1%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:923 ms6.1%
QueryTracker._django_wrapperflakytest/profiling/dbtrack.py:1003 ms6.1%
CursorWrapper._executedjango/db/backends/utils.py:1053 ms6.1%
Cursor.executepsycopg/cursor.py:1133 ms6.1%
Connection.waitpsycopg/connection.py:4953 ms6.1%
BaseCursor._execute_genpsycopg/_cursor_base.py:2063 ms6.1%
BaseCursor._maybe_prepare_genpsycopg/_cursor_base.py:2863 ms6.1%
ClientCursorMixin._execute_sendpsycopg/client_cursor.py:783 ms6.1%
SimpleTestCase._setup_and_calldjango/test/testcases.py:3713 ms6.1%
TransactionTestCase._post_teardowndjango/test/testcases.py:1240 self._fixture_teardown()3 ms6.1%
TestCase._fixture_teardowndjango/test/testcases.py:14973 ms6.1%
TestCase._rollback_atomicsdjango/test/testcases.py:14053 ms6.1%
Atomic.__exit__django/db/transaction.py:2833 ms6.1%
async_unsafe.<locals>.decorator.<locals>.innerdjango/utils/asyncio.py:263 ms6.1%
BaseDatabaseWrapper.savepoint_rollbackdjango/db/backends/base/base.py:4133 ms6.1%
BaseDatabaseWrapper._savepoint_rollbackdjango/db/backends/base/base.py:3713 ms6.1%
CursorWrapper.executedjango/db/backends/utils.py:793 ms6.1%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:923 ms6.1%
QueryTracker._django_wrapperflakytest/profiling/dbtrack.py:1003 ms6.1%
CursorWrapper._executedjango/db/backends/utils.py:1033 ms6.1%
Cursor.executepsycopg/cursor.py:1133 ms6.1%
Connection.waitpsycopg/connection.py:4953 ms6.1%
BaseCursor._execute_genpsycopg/_cursor_base.py:2063 ms6.1%
BaseCursor._maybe_prepare_genpsycopg/_cursor_base.py:2863 ms6.1%
ClientCursorMixin._execute_sendpsycopg/client_cursor.py:783 ms6.1%
Estimated from 17 samples; phase durations are exact. Frames from pytest and pluggy are shown .

Hot lines in your code

apps/api/tests.py:487
response = self.client.post(
ProfileUploadTest.upload · Libraries
33 ms
apps/api/urls.py:59
SecretTokens.objects.filter(pk__in=list(stale)).update(date_last_used=now)
touch_token · Database
5 ms
apps/api/urls.py:72
project = get_object_or_404(Project, secrettokens__token=request.headers.get("Authorization"))
api_request.<locals>.decorator.<locals>.wrapped_view · Database
3 ms

Fixtures

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

Database

10 queries · 3 ms
No repeated queries.

Biggest pieces of work

call test body
apps/api/tests.py:600
41 ms
call _post_teardown
django/test/testcases.py:1240
3 ms

Reliability

5 results · 0 CI failures · 0 local failures

This test hasn't failed recently.

History

Latest 5 results, oldest first in the strip
When Environment Outcome Duration Commit
2 hours ago CI github-actions:test passed 45 ms 9caa567 main Profile
2 hours ago CI github-actions:test passed 41 ms ec75501 main Profile
9 hours ago CI github-actions:test passed 43 ms d2c12e5 main Profile
9 hours ago CI github-actions:test passed 22 ms 0b902f6 main Profile
9 hours ago CI github-actions:test passed 36 ms 78a4357 main Profile