Tests / apps/api/tests.py
ProfileUploadTest::test_reject_invalid_gzip
First seen 7 hours ago in 78a4357
CI
github-actions:test
5 runs
Average
37 ms
median 39 ms
max 43 ms
max 43 ms
Phases
Setup 0.76 ms
Call 36 ms
Teardown 0.17 ms
Categories
Database 5 ms
Other (Libraries, Unsampled, pytest) 32 ms
10 database queries per run
Needs 518 KB of memory (max 828 KB)
Duration per run
Where the time goes
Latest run in ci:github-actions:test, 18 minutes ago ·
open run
call38 ms97.4%
ProfileUploadTest.test_reject_invalid_gzipapps/api/tests.py:605 response = self.upload(b"\x1f\x8bnot really gzip")33 ms84.4%
ProfileUploadTest.uploadapps/api/tests.py:487 response = self.client.post(33 ms84.4%
Client.postdjango/test/client.py:115333 ms84.4%
RequestFactory.postdjango/test/client.py:49933 ms84.4%
RequestFactory.genericdjango/test/client.py:67133 ms84.4%
Client.requestdjango/test/client.py:108233 ms84.4%
ClientHandler.__call__django/test/client.py:17326 ms64.9%
BaseHandler.load_middlewaredjango/core/handlers/base.py:6226 ms64.9%
WhiteNoiseMiddleware.__init__whitenoise/middleware.py:10426 ms64.9%
WhiteNoise.add_fileswhitenoise/base.py:10826 ms64.9%
WhiteNoise.update_files_dictionarywhitenoise/base.py:12018 ms45.4%
WhiteNoise.add_file_to_dictionarywhitenoise/base.py:13118 ms45.4%
WhiteNoise.get_static_filewhitenoise/base.py:20815 ms38.9%
StaticFile.__init__whitenoise/responders.py:738 ms19.5%
StaticFile.get_headerswhitenoise/responders.py:1715 ms13.0%
StaticFile.__init__whitenoise/responders.py:778 ms19.5%
StaticFile.get_alternativeswhitenoise/responders.py:2005 ms13.0%
StaticFile.get_alternativeswhitenoise/responders.py:2013 ms6.5%
WhiteNoise.get_static_filewhitenoise/base.py:2033 ms6.5%
WhiteNoise.add_cache_headerswhitenoise/base.py:2243 ms6.5%
WhiteNoiseMiddleware.immutable_file_testwhitenoise/middleware.py:1763 ms6.5%
WhiteNoiseMiddleware.get_static_urlwhitenoise/middleware.py:1973 ms6.5%
URLMixin.urldebug_toolbar/panels/staticfiles.py:203 ms6.5%
HashedFilesMixin.urldjango/contrib/staticfiles/storage.py:2053 ms6.5%
HashedFilesMixin._urldjango/contrib/staticfiles/storage.py:1863 ms6.5%
WhiteNoise.update_files_dictionarywhitenoise/base.py:1155 ms13.0%
scantreewhitenoise/base.py:2643 ms6.5%
scantreewhitenoise/base.py:2623 ms6.5%
scantreewhitenoise/base.py:2623 ms6.5%
scantreewhitenoise/base.py:2623 ms6.5%
scantreewhitenoise/base.py:2623 ms6.5%
scantreewhitenoise/base.py:2623 ms6.5%
scantreewhitenoise/base.py:2643 ms6.5%
ClientHandler.__call__django/test/client.py:1868 ms19.5%
BaseHandler.get_responsedjango/core/handlers/base.py:1418 ms19.5%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:558 ms19.5%
DebugToolbarMiddleware.__call__debug_toolbar/middleware.py:1308 ms19.5%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:558 ms19.5%
MiddlewareMixin.__call__django/utils/deprecation.py:3098 ms19.5%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:558 ms19.5%
WhiteNoiseMiddleware.__call__whitenoise/middleware.py:1238 ms19.5%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:558 ms19.5%
MiddlewareMixin.__call__django/utils/deprecation.py:3098 ms19.5%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:558 ms19.5%
MiddlewareMixin.__call__django/utils/deprecation.py:3098 ms19.5%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:558 ms19.5%
MiddlewareMixin.__call__django/utils/deprecation.py:3098 ms19.5%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:558 ms19.5%
MiddlewareMixin.__call__django/utils/deprecation.py:3098 ms19.5%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:558 ms19.5%
MiddlewareMixin.__call__django/utils/deprecation.py:3098 ms19.5%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:558 ms19.5%
MiddlewareMixin.__call__django/utils/deprecation.py:3098 ms19.5%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:558 ms19.5%
AccountMiddleware.<locals>.middlewareallauth/account/middleware.py:348 ms19.5%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:558 ms19.5%
BaseHandler._get_responsedjango/core/handlers/base.py:1988 ms19.5%
csrf_exempt.<locals>._view_wrapperdjango/views/decorators/csrf.py:658 ms19.5%
jsonify_errors.<locals>.wrapped_viewapps/api/urls.py:378 ms19.5%
require_http_methods.<locals>.decorator.<locals>.innerdjango/views/decorators/http.py:648 ms19.5%
api_request.<locals>.decorator.<locals>.wrapped_viewapps/api/urls.py:73 touch_token(request.headers.get("Authorization"))5 ms13.0%
touch_tokenapps/api/urls.py:59 SecretTokens.objects.filter(pk__in=list(stale)).update(date_last_used=now)3 ms6.5%
QuerySet.__iter__django/db/models/query.py:3903 ms6.5%
QuerySet._fetch_alldjango/db/models/query.py:20003 ms6.5%
FlatValuesListIterable.__iter__django/db/models/query.py:2773 ms6.5%
SQLCompiler.results_iterdjango/db/models/sql/compiler.py:15733 ms6.5%
SQLCompiler.execute_sqldjango/db/models/sql/compiler.py:16243 ms6.5%
CursorWrapper.executedjango/db/backends/utils.py:793 ms6.5%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:923 ms6.5%
CursorWrapper._executedjango/db/backends/utils.py:1053 ms6.5%
Cursor.executepsycopg/cursor.py:1133 ms6.5%
Connection.waitpsycopg/connection.py:4953 ms6.5%
Atomic.__exit__django/db/transaction.py:2473 ms6.5%
async_unsafe.<locals>.decorator.<locals>.innerdjango/utils/asyncio.py:263 ms6.5%
BaseDatabaseWrapper.savepoint_commitdjango/db/backends/base/base.py:4313 ms6.5%
BaseDatabaseWrapper._savepoint_commitdjango/db/backends/base/base.py:3753 ms6.5%
CursorWrapper.executedjango/db/backends/utils.py:793 ms6.5%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:923 ms6.5%
CursorWrapper._executedjango/db/backends/utils.py:1033 ms6.5%
Cursor.executepsycopg/cursor.py:1133 ms6.5%
Connection.waitpsycopg/connection.py:4953 ms6.5%
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.5%
get_object_or_404django/shortcuts.py:903 ms6.5%
QuerySet.getdjango/db/models/query.py:6353 ms6.5%
QuerySet.__len__django/db/models/query.py:3723 ms6.5%
QuerySet._fetch_alldjango/db/models/query.py:20003 ms6.5%
ModelIterable.__iter__django/db/models/query.py:1273 ms6.5%
TransactionTestCase._pre_setupdjango/test/testcases.py:1164 cls._fixture_setup()3 ms6.5%
TestCase._fixture_setupdjango/test/testcases.py:14783 ms6.5%
TestCase._enter_atomicsdjango/test/testcases.py:13963 ms6.5%
Atomic.__enter__django/db/transaction.py:2113 ms6.5%
async_unsafe.<locals>.decorator.<locals>.innerdjango/utils/asyncio.py:263 ms6.5%
BaseDatabaseWrapper.savepointdjango/db/backends/base/base.py:4003 ms6.5%
BaseDatabaseWrapper._savepointdjango/db/backends/base/base.py:3673 ms6.5%
CursorWrapper.executedjango/db/backends/utils.py:793 ms6.5%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:923 ms6.5%
CursorWrapper._executedjango/db/backends/utils.py:1033 ms6.5%
Cursor.executepsycopg/cursor.py:1133 ms6.5%
Connection.waitpsycopg/connection.py:4953 ms6.5%
BaseCursor._execute_genpsycopg/_cursor_base.py:2063 ms6.5%
BaseCursor._maybe_prepare_genpsycopg/_cursor_base.py:2863 ms6.5%
ClientCursorMixin._execute_sendpsycopg/client_cursor.py:783 ms6.5%
TransactionTestCase._post_teardowndjango/test/testcases.py:1240 self._fixture_teardown()3 ms6.5%
TestCase._fixture_teardowndjango/test/testcases.py:14953 ms6.5%
DatabaseWrapper.check_constraintsdjango/db/backends/postgresql/base.py:4833 ms6.5%
CursorWrapper.executedjango/db/backends/utils.py:793 ms6.5%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:923 ms6.5%
CursorWrapper._executedjango/db/backends/utils.py:1033 ms6.5%
Cursor.executepsycopg/cursor.py:1133 ms6.5%
Connection.waitpsycopg/connection.py:4953 ms6.5%
Estimated from 15 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
|
26 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 |
|
apps/api/urls.py:59
SecretTokens.objects.filter(pk__in=list(stale)).update(date_last_used=now)
touch_token
· Database
|
3 ms |
|
apps/api/urls.py:73
touch_token(request.headers.get("Authorization"))
api_request.<locals>.decorator.<locals>.wrapped_view
· Database
|
3 ms |
Fixtures
Exact setup time| _live_server_helper function | 0.08 ms |
| _django_db_marker function | 0.06 ms |
| _dj_autoclear_mailbox function | 0.05 ms |
| _django_set_urlconf function | 0.05 ms |
| _template_string_if_invalid_marker function | 0.04 ms |
| _django_clear_site_cache function | 0.04 ms |
| monkeypatch function | 0.03 ms |
Database
10 queries · 3 msNo repeated queries.
Biggest pieces of work
|
call test body
apps/api/tests.py:605
|
33 ms |
|
call _pre_setup
django/test/testcases.py:1164
|
3 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 | |
|---|---|---|---|---|
| 18 minutes ago | CI github-actions:test | passed | 39 ms | Profile |
| 43 minutes ago | CI github-actions:test | passed | 39 ms | Profile |
| 7 hours ago | CI github-actions:test | passed | 43 ms | Profile |
| 7 hours ago | CI github-actions:test | passed | 24 ms | Profile |
| 7 hours ago | CI github-actions:test | passed | 41 ms | Profile |