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

ProfileUploadTest::test_reject_invalid_json

First seen 1 month, 1 week ago in 78a4357
CI github-actions:test 15 runs
Average
34 ms
median 34 ms
max 46 ms
Phases
Setup 0.65 ms Call 33 ms Teardown 0.15 ms
Categories
Database 4 ms Other (Libraries, Unsampled, Serialization, Logging, ...) 29 ms

10 database queries per run

Needs 255 KB of memory (max 776 KB)

Duration per run

Where the time goes

Latest run in ci:github-actions:test, 2 weeks ago · open run
Show pytest frames
call23 ms97.3%
ProfileUploadTest.test_reject_invalid_jsonapps/api/tests.py:600 response = self.upload(b"{nope")19 ms77.9%
ProfileUploadTest.uploadapps/api/tests.py:487 response = self.client.post(19 ms77.9%
Client.postdjango/test/client.py:115319 ms77.9%
RequestFactory.postdjango/test/client.py:49919 ms77.9%
RequestFactory.genericdjango/test/client.py:67119 ms77.9%
Client.requestdjango/test/client.py:108219 ms77.9%
ClientHandler.__call__django/test/client.py:17312 ms48.7%
BaseHandler.load_middlewaredjango/core/handlers/base.py:6212 ms48.7%
WhiteNoiseMiddleware.__init__whitenoise/middleware.py:10412 ms48.7%
WhiteNoise.add_fileswhitenoise/base.py:10812 ms48.7%
WhiteNoise.update_files_dictionarywhitenoise/base.py:12012 ms48.7%
WhiteNoise.add_file_to_dictionarywhitenoise/base.py:1319 ms38.9%
WhiteNoise.get_static_filewhitenoise/base.py:2089 ms38.9%
StaticFile.__init__whitenoise/responders.py:725 ms19.5%
StaticFile.get_file_statswhitenoise/responders.py:1615 ms19.5%
StaticFile.__init__whitenoise/responders.py:772 ms9.7%
StaticFile.get_alternativeswhitenoise/responders.py:2012 ms9.7%
StaticFile.__init__whitenoise/responders.py:742 ms9.7%
parsedate<stdlib>/email/_parseaddr.py:1852 ms9.7%
WhiteNoise.add_file_to_dictionarywhitenoise/base.py:1232 ms9.7%
WhiteNoise.is_compressed_variantwhitenoise/base.py:1942 ms9.7%
ClientHandler.__call__django/test/client.py:1867 ms29.2%
BaseHandler.get_responsedjango/core/handlers/base.py:1417 ms29.2%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:557 ms29.2%
DebugToolbarMiddleware.__call__debug_toolbar/middleware.py:1307 ms29.2%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:557 ms29.2%
MiddlewareMixin.__call__django/utils/deprecation.py:3097 ms29.2%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:557 ms29.2%
WhiteNoiseMiddleware.__call__whitenoise/middleware.py:1237 ms29.2%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:557 ms29.2%
MiddlewareMixin.__call__django/utils/deprecation.py:3097 ms29.2%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:557 ms29.2%
MiddlewareMixin.__call__django/utils/deprecation.py:3097 ms29.2%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:557 ms29.2%
MiddlewareMixin.__call__django/utils/deprecation.py:3097 ms29.2%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:557 ms29.2%
MiddlewareMixin.__call__django/utils/deprecation.py:3097 ms29.2%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:557 ms29.2%
MiddlewareMixin.__call__django/utils/deprecation.py:3097 ms29.2%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:557 ms29.2%
MiddlewareMixin.__call__django/utils/deprecation.py:3097 ms29.2%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:557 ms29.2%
AccountMiddleware.<locals>.middlewareallauth/account/middleware.py:347 ms29.2%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:557 ms29.2%
BaseHandler._get_responsedjango/core/handlers/base.py:1987 ms29.2%
csrf_exempt.<locals>._view_wrapperdjango/views/decorators/csrf.py:657 ms29.2%
jsonify_errors.<locals>.wrapped_viewapps/api/urls.py:377 ms29.2%
require_http_methods.<locals>.decorator.<locals>.innerdjango/views/decorators/http.py:647 ms29.2%
api_request.<locals>.decorator.<locals>.wrapped_viewapps/api/urls.py:72 project = get_object_or_404(Project, secrettokens__token=request.headers.get("Authorization"))2 ms9.7%
get_object_or_404django/shortcuts.py:902 ms9.7%
QuerySet.getdjango/db/models/query.py:6352 ms9.7%
QuerySet.__len__django/db/models/query.py:3722 ms9.7%
QuerySet._fetch_alldjango/db/models/query.py:20002 ms9.7%
ModelIterable.__iter__django/db/models/query.py:952 ms9.7%
SQLCompiler.execute_sqldjango/db/models/sql/compiler.py:16242 ms9.7%
CursorWrapper.executedjango/db/backends/utils.py:792 ms9.7%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:922 ms9.7%
CursorWrapper._executedjango/db/backends/utils.py:1052 ms9.7%
Cursor.executepsycopg/cursor.py:1132 ms9.7%
Connection.waitpsycopg/connection.py:4952 ms9.7%
api_request.<locals>.decorator.<locals>.wrapped_viewapps/api/urls.py:73 touch_token(request.headers.get("Authorization"))2 ms9.7%
touch_tokenapps/api/urls.py:59 SecretTokens.objects.filter(pk__in=list(stale)).update(date_last_used=now)2 ms9.7%
QuerySet.__iter__django/db/models/query.py:3902 ms9.7%
QuerySet._fetch_alldjango/db/models/query.py:20002 ms9.7%
FlatValuesListIterable.__iter__django/db/models/query.py:2772 ms9.7%
SQLCompiler.results_iterdjango/db/models/sql/compiler.py:15732 ms9.7%
SQLCompiler.execute_sqldjango/db/models/sql/compiler.py:16242 ms9.7%
CursorWrapper.executedjango/db/backends/utils.py:792 ms9.7%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:922 ms9.7%
CursorWrapper._executedjango/db/backends/utils.py:1052 ms9.7%
Cursor.executepsycopg/cursor.py:1132 ms9.7%
Connection.waitpsycopg/connection.py:4952 ms9.7%
api_request.<locals>.decorator.<locals>.wrapped_viewapps/api/urls.py:75 return view_func(request, *args, **kwargs)2 ms9.7%
profile_uploadapps/api/urls.py:1372 ms9.7%
parse_documentapps/projects/profiles.py:802 ms9.7%
loadsapps/projects/profiles.py:118 document = json.loads(data)2 ms9.7%
loads<stdlib>/json/__init__.py:3712 ms9.7%
JSONDecoder.decode<stdlib>/json/decoder.py:3582 ms9.7%
TransactionTestCase._pre_setupdjango/test/testcases.py:1164 cls._fixture_setup()2 ms9.7%
TestCase._fixture_setupdjango/test/testcases.py:14782 ms9.7%
TestCase._enter_atomicsdjango/test/testcases.py:13962 ms9.7%
Atomic.__enter__django/db/transaction.py:2112 ms9.7%
async_unsafe.<locals>.decorator.<locals>.innerdjango/utils/asyncio.py:262 ms9.7%
BaseDatabaseWrapper.savepointdjango/db/backends/base/base.py:4002 ms9.7%
BaseDatabaseWrapper._savepointdjango/db/backends/base/base.py:3672 ms9.7%
CursorWrapper.executedjango/db/backends/utils.py:792 ms9.7%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:922 ms9.7%
CursorWrapper._executedjango/db/backends/utils.py:1032 ms9.7%
Cursor.executepsycopg/cursor.py:1132 ms9.7%
Connection.waitpsycopg/connection.py:4952 ms9.7%
TransactionTestCase._post_teardowndjango/test/testcases.py:1240 self._fixture_teardown()2 ms9.7%
TestCase._fixture_teardowndjango/test/testcases.py:14972 ms9.7%
TestCase._rollback_atomicsdjango/test/testcases.py:14052 ms9.7%
Atomic.__exit__django/db/transaction.py:2862 ms9.7%
async_unsafe.<locals>.decorator.<locals>.innerdjango/utils/asyncio.py:262 ms9.7%
BaseDatabaseWrapper.savepoint_commitdjango/db/backends/base/base.py:4312 ms9.7%
BaseDatabaseWrapper._savepoint_commitdjango/db/backends/base/base.py:3752 ms9.7%
CursorWrapper.executedjango/db/backends/utils.py:792 ms9.7%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:922 ms9.7%
CursorWrapper._executedjango/db/backends/utils.py:1032 ms9.7%
Cursor.executepsycopg/cursor.py:1132 ms9.7%
Connection.waitpsycopg/connection.py:4952 ms9.7%
Estimated from 10 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
12 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
2 ms
apps/api/urls.py:59
SecretTokens.objects.filter(pk__in=list(stale)).update(date_last_used=now)
touch_token · Database
2 ms
apps/projects/profiles.py:118
document = json.loads(data)
loads · Serialization
2 ms

Fixtures

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

Database

10 queries · 2 ms
No repeated queries.

Biggest pieces of work

call test body
apps/api/tests.py:600
19 ms
call _pre_setup
django/test/testcases.py:1164
2 ms
call _post_teardown
django/test/testcases.py:1240
2 ms

Reliability

15 results · 0 CI failures · 0 local failures

This test hasn't failed recently.

History

Latest 15 results, oldest first in the strip
When Environment Outcome Duration Commit
2 weeks ago CI github-actions:test passed 24 ms cb18ed3 main Profile
2 weeks, 4 days ago CI github-actions:test passed 42 ms 9bd5864 main Profile
2 weeks, 6 days ago CI github-actions:test passed 22 ms 19dac9b main Profile
3 weeks ago CI github-actions:test passed 34 ms e141198 main Profile
1 month ago CI github-actions:test passed 20 ms 46ec2aa main Profile
1 month ago CI github-actions:test passed 33 ms afde85b main Profile
1 month ago CI github-actions:test passed 33 ms fe29f9d main Profile
1 month ago CI github-actions:test passed 46 ms 044719a main Profile
1 month ago CI github-actions:test passed 22 ms b3fedae main Profile
1 month, 1 week ago CI github-actions:test passed 44 ms 43c4eda main Profile
1 month, 1 week ago CI github-actions:test passed 45 ms 9caa567 main Profile
1 month, 1 week ago CI github-actions:test passed 41 ms ec75501 main Profile
1 month, 1 week ago CI github-actions:test passed 43 ms d2c12e5 main Profile
1 month, 1 week ago CI github-actions:test passed 22 ms 0b902f6 main Profile
1 month, 1 week ago CI github-actions:test passed 36 ms 78a4357 main Profile