Tests / apps/api/tests.py
ProfileUploadTest::test_reject_invalid_json
First seen 8 hours ago in 78a4357
CI
github-actions:test
5 runs
Average
37 ms
median 41 ms
max 45 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, an hour ago ·
open run
setup0.77 ms1.7%
call44 ms97.8%
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%
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%
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%
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%
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%
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
hidden
.
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 msNo 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 failuresThis test hasn't failed recently.
History
Latest 5 results, oldest first in the strip| When | Environment | Outcome | Duration | |
|---|---|---|---|---|
| an hour ago | CI github-actions:test | passed | 45 ms | Profile |
| an hour ago | CI github-actions:test | passed | 41 ms | Profile |
| 8 hours ago | CI github-actions:test | passed | 43 ms | Profile |
| 8 hours ago | CI github-actions:test | passed | 22 ms | Profile |
| 8 hours ago | CI github-actions:test | passed | 36 ms | Profile |