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

ProfileUploadTest::test_reject_invalid_json

First seen 3 weeks ago in 78a4357
CI github-actions:test 12 runs
Average
35 ms
median 35 ms
max 46 ms
Phases
Setup 0.68 ms Call 34 ms Teardown 0.15 ms
Categories
Database 5 ms Other (Libraries, Unsampled, Logging, pytest) 30 ms

10 database queries per run

Needs 190 KB of memory (max 648 KB)

Duration per run

Where the time goes

Latest run in ci:github-actions:test, 16 hours ago · open run
Show pytest frames
call33 ms97.1%
ProfileUploadTest.test_reject_invalid_jsonapps/api/tests.py:600 response = self.upload(b"{nope")32 ms93.5%
ProfileUploadTest.uploadapps/api/tests.py:487 response = self.client.post(32 ms93.5%
Client.postdjango/test/client.py:115332 ms93.5%
RequestFactory.postdjango/test/client.py:49932 ms93.5%
RequestFactory.genericdjango/test/client.py:67132 ms93.5%
Client.requestdjango/test/client.py:108232 ms93.5%
ClientHandler.__call__django/test/client.py:17329 ms86.3%
BaseHandler.load_middlewaredjango/core/handlers/base.py:6229 ms86.3%
WhiteNoiseMiddleware.__init__whitenoise/middleware.py:10429 ms86.3%
WhiteNoise.add_fileswhitenoise/base.py:10829 ms86.3%
WhiteNoise.update_files_dictionarywhitenoise/base.py:12016 ms46.8%
WhiteNoise.add_file_to_dictionarywhitenoise/base.py:13116 ms46.8%
WhiteNoise.get_static_filewhitenoise/base.py:20815 ms43.2%
StaticFile.__init__whitenoise/responders.py:736 ms18.0%
StaticFile.get_headerswhitenoise/responders.py:1784 ms10.8%
parsedate<stdlib>/email/_parseaddr.py:1851 ms3.6%
StaticFile.get_headerswhitenoise/responders.py:1762 ms7.2%
formatdate<stdlib>/email/utils.py:2661 ms3.6%
StaticFile.__init__whitenoise/responders.py:742 ms7.2%
parsedate<stdlib>/email/_parseaddr.py:1852 ms7.2%
StaticFile.__init__whitenoise/responders.py:772 ms7.2%
StaticFile.get_alternativeswhitenoise/responders.py:2001 ms3.6%
StaticFile.get_alternativeswhitenoise/responders.py:2011 ms3.6%
StaticFile.__init__whitenoise/responders.py:721 ms3.6%
StaticFile.__init__whitenoise/responders.py:761 ms3.6%
StaticFile.get_not_modified_responsewhitenoise/responders.py:1891 ms3.6%
Headers.__getitem__<stdlib>/wsgiref/headers.py:831 ms3.6%
Headers.get<stdlib>/wsgiref/headers.py:1061 ms3.6%
WhiteNoise.get_static_filewhitenoise/base.py:2031 ms3.6%
WhiteNoise.add_cache_headerswhitenoise/base.py:2241 ms3.6%
WhiteNoiseMiddleware.immutable_file_testwhitenoise/middleware.py:1761 ms3.6%
WhiteNoiseMiddleware.get_static_urlwhitenoise/middleware.py:1971 ms3.6%
URLMixin.urldebug_toolbar/panels/staticfiles.py:201 ms3.6%
HashedFilesMixin.urldjango/contrib/staticfiles/storage.py:2051 ms3.6%
HashedFilesMixin._urldjango/contrib/staticfiles/storage.py:1861 ms3.6%
WhiteNoise.update_files_dictionarywhitenoise/base.py:11512 ms36.0%
scantreewhitenoise/base.py:26210 ms28.8%
scantreewhitenoise/base.py:26210 ms28.8%
scantreewhitenoise/base.py:2627 ms21.6%
scantreewhitenoise/base.py:2626 ms18.0%
scantreewhitenoise/base.py:2624 ms10.8%
scantreewhitenoise/base.py:2642 ms7.2%
scantreewhitenoise/base.py:2601 ms3.6%
scantreewhitenoise/base.py:2642 ms7.2%
scantreewhitenoise/base.py:2641 ms3.6%
scantreewhitenoise/base.py:2642 ms7.2%
ClientHandler.__call__django/test/client.py:1862 ms7.2%
BaseHandler.get_responsedjango/core/handlers/base.py:1411 ms3.6%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:551 ms3.6%
DebugToolbarMiddleware.__call__debug_toolbar/middleware.py:1301 ms3.6%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:551 ms3.6%
MiddlewareMixin.__call__django/utils/deprecation.py:3091 ms3.6%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:551 ms3.6%
WhiteNoiseMiddleware.__call__whitenoise/middleware.py:1231 ms3.6%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:551 ms3.6%
MiddlewareMixin.__call__django/utils/deprecation.py:3091 ms3.6%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:551 ms3.6%
MiddlewareMixin.__call__django/utils/deprecation.py:3091 ms3.6%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:551 ms3.6%
MiddlewareMixin.__call__django/utils/deprecation.py:3091 ms3.6%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:551 ms3.6%
MiddlewareMixin.__call__django/utils/deprecation.py:3091 ms3.6%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:551 ms3.6%
MiddlewareMixin.__call__django/utils/deprecation.py:3091 ms3.6%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:551 ms3.6%
MiddlewareMixin.__call__django/utils/deprecation.py:3091 ms3.6%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:551 ms3.6%
AccountMiddleware.<locals>.middlewareallauth/account/middleware.py:341 ms3.6%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:551 ms3.6%
BaseHandler._get_responsedjango/core/handlers/base.py:1981 ms3.6%
csrf_exempt.<locals>._view_wrapperdjango/views/decorators/csrf.py:651 ms3.6%
jsonify_errors.<locals>.wrapped_viewapps/api/urls.py:371 ms3.6%
require_http_methods.<locals>.decorator.<locals>.innerdjango/views/decorators/http.py:641 ms3.6%
api_request.<locals>.decorator.<locals>.wrapped_viewapps/api/urls.py:73 touch_token(request.headers.get("Authorization"))1 ms3.6%
touch_tokenapps/api/urls.py:59 SecretTokens.objects.filter(pk__in=list(stale)).update(date_last_used=now)1 ms3.6%
BaseManager._get_queryset_methods.<locals>.create_method.<locals>.manager_methoddjango/db/models/manager.py:871 ms3.6%
QuerySet.filterdjango/db/models/query.py:15421 ms3.6%
QuerySet._filter_or_excludedjango/db/models/query.py:15601 ms3.6%
QuerySet._filter_or_exclude_inplacedjango/db/models/query.py:15701 ms3.6%
Query.add_qdjango/db/models/sql/query.py:16711 ms3.6%
Query._add_qdjango/db/models/sql/query.py:17031 ms3.6%
Query.build_filterdjango/db/models/sql/query.py:15601 ms3.6%
Query.resolve_lookup_valuedjango/db/models/sql/query.py:13411 ms3.6%
BaseHandler.get_responsedjango/core/handlers/base.py:1441 ms3.6%
log_responsedjango/utils/log.py:2801 ms3.6%
log_messagedjango/utils/log.py:2491 ms3.6%
Logger.warning<stdlib>/logging/__init__.py:15401 ms3.6%
Logger._log<stdlib>/logging/__init__.py:16731 ms3.6%
Logger.handle<stdlib>/logging/__init__.py:16891 ms3.6%
Logger.callHandlers<stdlib>/logging/__init__.py:17491 ms3.6%
Handler.handle<stdlib>/logging/__init__.py:10301 ms3.6%
StreamHandler.emit<stdlib>/logging/__init__.py:11581 ms3.6%
TransactionTestCase._post_teardowndjango/test/testcases.py:1240 self._fixture_teardown()1 ms3.6%
TestCase._fixture_teardowndjango/test/testcases.py:14971 ms3.6%
TestCase._rollback_atomicsdjango/test/testcases.py:14051 ms3.6%
Atomic.__exit__django/db/transaction.py:2831 ms3.6%
async_unsafe.<locals>.decorator.<locals>.innerdjango/utils/asyncio.py:261 ms3.6%
BaseDatabaseWrapper.savepoint_rollbackdjango/db/backends/base/base.py:4131 ms3.6%
BaseDatabaseWrapper._savepoint_rollbackdjango/db/backends/base/base.py:3711 ms3.6%
CursorWrapper.executedjango/db/backends/utils.py:791 ms3.6%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:921 ms3.6%
CursorWrapper._executedjango/db/backends/utils.py:1031 ms3.6%
Cursor.executepsycopg/cursor.py:1131 ms3.6%
Connection.waitpsycopg/connection.py:4951 ms3.6%
Estimated from 27 samples; phase durations are exact. Frames from pytest and pluggy are hidden .

Hot lines in your code

apps/api/tests.py:487
response = self.client.post(
ProfileUploadTest.upload · Libraries
31 ms
apps/api/urls.py:59
SecretTokens.objects.filter(pk__in=list(stale)).update(date_last_used=now)
touch_token · Database
1 ms

Fixtures

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

Database

10 queries · 2 ms
No repeated queries.

Biggest pieces of work

call test body
apps/api/tests.py:600
32 ms
call _post_teardown
django/test/testcases.py:1240
1 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 34 ms e141198 main Profile
1 week, 5 days ago CI github-actions:test passed 20 ms 46ec2aa main Profile
2 weeks, 1 day ago CI github-actions:test passed 33 ms afde85b main Profile
2 weeks, 1 day ago CI github-actions:test passed 33 ms fe29f9d main Profile
2 weeks, 1 day ago CI github-actions:test passed 46 ms 044719a main Profile
2 weeks, 2 days ago CI github-actions:test passed 22 ms b3fedae main Profile
2 weeks, 4 days ago CI github-actions:test passed 44 ms 43c4eda main Profile
2 weeks, 6 days ago CI github-actions:test passed 45 ms 9caa567 main Profile
2 weeks, 6 days ago CI github-actions:test passed 41 ms ec75501 main Profile
3 weeks ago CI github-actions:test passed 43 ms d2c12e5 main Profile
3 weeks ago CI github-actions:test passed 22 ms 0b902f6 main Profile
3 weeks ago CI github-actions:test passed 36 ms 78a4357 main Profile