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

ProfileUploadTest::test_reject_other_formats

First seen 1 month, 1 week ago in 78a4357
CI github-actions:test 15 runs
Average
38 ms
median 38 ms
max 61 ms
Phases
Setup 0.66 ms Call 37 ms Teardown 0.16 ms
Categories
Database 5 ms Test code 0.41 ms Other (Libraries, Unsampled, pytest, Logging) 32 ms

11 database queries per run

Needs 511 KB of memory (max 860 KB)

Duration per run

Where the time goes

Latest run in ci:github-actions:test, 2 weeks ago · open run
Show pytest frames
call26 ms97.7%
ProfileUploadTest.test_reject_other_formatsapps/api/tests.py:590 response = self.upload({"format": "something-else", "run": {}})24 ms90.1%
ProfileUploadTest.uploadapps/api/tests.py:487 response = self.client.post(24 ms90.1%
Client.postdjango/test/client.py:115324 ms90.1%
RequestFactory.postdjango/test/client.py:49924 ms90.1%
RequestFactory.genericdjango/test/client.py:67124 ms90.1%
Client.requestdjango/test/client.py:108224 ms90.1%
ClientHandler.__call__django/test/client.py:17318 ms67.6%
BaseHandler.load_middlewaredjango/core/handlers/base.py:6218 ms67.6%
WhiteNoiseMiddleware.__init__whitenoise/middleware.py:10418 ms67.6%
WhiteNoise.add_fileswhitenoise/base.py:10818 ms67.6%
WhiteNoise.update_files_dictionarywhitenoise/base.py:12014 ms52.6%
WhiteNoise.add_file_to_dictionarywhitenoise/base.py:13112 ms45.1%
WhiteNoise.get_static_filewhitenoise/base.py:2088 ms30.0%
StaticFile.__init__whitenoise/responders.py:774 ms15.0%
StaticFile.get_alternativeswhitenoise/responders.py:2012 ms7.5%
Headers.__setitem__<stdlib>/wsgiref/headers.py:622 ms7.5%
Headers.__delitem__<stdlib>/wsgiref/headers.py:722 ms7.5%
<GC>~2 ms7.5%
StaticFile.get_alternativeswhitenoise/responders.py:2002 ms7.5%
StaticFile.__init__whitenoise/responders.py:722 ms7.5%
StaticFile.get_file_statswhitenoise/responders.py:1612 ms7.5%
__init____init__:-12 ms7.5%
FileEntry.__init__whitenoise/responders.py:2632 ms7.5%
FileEntry.stat_regular_filewhitenoise/responders.py:2762 ms7.5%
<GC>~2 ms7.5%
StaticFile.__init__whitenoise/responders.py:732 ms7.5%
StaticFile.get_headerswhitenoise/responders.py:1762 ms7.5%
formatdate<stdlib>/email/utils.py:2662 ms7.5%
WhiteNoise.get_static_filewhitenoise/base.py:2022 ms7.5%
WhiteNoise.get_static_filewhitenoise/base.py:2032 ms7.5%
WhiteNoise.add_cache_headerswhitenoise/base.py:2242 ms7.5%
WhiteNoiseMiddleware.immutable_file_testwhitenoise/middleware.py:1762 ms7.5%
WhiteNoiseMiddleware.get_static_urlwhitenoise/middleware.py:1972 ms7.5%
URLMixin.urldebug_toolbar/panels/staticfiles.py:202 ms7.5%
HashedFilesMixin.urldjango/contrib/staticfiles/storage.py:2052 ms7.5%
HashedFilesMixin._urldjango/contrib/staticfiles/storage.py:1842 ms7.5%
WhiteNoise.update_files_dictionarywhitenoise/base.py:1154 ms15.0%
scantreewhitenoise/base.py:2624 ms15.0%
scantreewhitenoise/base.py:2622 ms7.5%
scantreewhitenoise/base.py:2622 ms7.5%
scantreewhitenoise/base.py:2622 ms7.5%
scantreewhitenoise/base.py:2642 ms7.5%
ClientHandler.__call__django/test/client.py:1866 ms22.5%
BaseHandler.get_responsedjango/core/handlers/base.py:1416 ms22.5%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:556 ms22.5%
DebugToolbarMiddleware.__call__debug_toolbar/middleware.py:1306 ms22.5%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:556 ms22.5%
MiddlewareMixin.__call__django/utils/deprecation.py:3096 ms22.5%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:556 ms22.5%
WhiteNoiseMiddleware.__call__whitenoise/middleware.py:1236 ms22.5%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:556 ms22.5%
MiddlewareMixin.__call__django/utils/deprecation.py:3096 ms22.5%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:556 ms22.5%
MiddlewareMixin.__call__django/utils/deprecation.py:3096 ms22.5%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:556 ms22.5%
MiddlewareMixin.__call__django/utils/deprecation.py:3096 ms22.5%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:556 ms22.5%
MiddlewareMixin.__call__django/utils/deprecation.py:3096 ms22.5%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:556 ms22.5%
MiddlewareMixin.__call__django/utils/deprecation.py:3096 ms22.5%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:556 ms22.5%
MiddlewareMixin.__call__django/utils/deprecation.py:3096 ms22.5%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:556 ms22.5%
AccountMiddleware.<locals>.middlewareallauth/account/middleware.py:346 ms22.5%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:556 ms22.5%
BaseHandler._get_responsedjango/core/handlers/base.py:1986 ms22.5%
csrf_exempt.<locals>._view_wrapperdjango/views/decorators/csrf.py:656 ms22.5%
jsonify_errors.<locals>.wrapped_viewapps/api/urls.py:376 ms22.5%
require_http_methods.<locals>.decorator.<locals>.innerdjango/views/decorators/http.py:646 ms22.5%
api_request.<locals>.decorator.<locals>.wrapped_viewapps/api/urls.py:73 touch_token(request.headers.get("Authorization"))6 ms22.5%
touch_tokenapps/api/urls.py:56 .filter(Q(date_last_used__lt=now - TOKEN_TOUCH_INTERVAL) | Q(date_last_used=None), token=token)4 ms15.0%
QuerySet.filterdjango/db/models/query.py:15424 ms15.0%
QuerySet._filter_or_excludedjango/db/models/query.py:15604 ms15.0%
QuerySet._filter_or_exclude_inplacedjango/db/models/query.py:15704 ms15.0%
Query.add_qdjango/db/models/sql/query.py:16712 ms7.5%
Query._add_qdjango/db/models/sql/query.py:17032 ms7.5%
Query.build_filterdjango/db/models/sql/query.py:15282 ms7.5%
Query._add_qdjango/db/models/sql/query.py:17032 ms7.5%
Query.build_filterdjango/db/models/sql/query.py:15862 ms7.5%
Atomic.__enter__django/db/transaction.py:2112 ms7.5%
async_unsafe.<locals>.decorator.<locals>.innerdjango/utils/asyncio.py:262 ms7.5%
BaseDatabaseWrapper.savepointdjango/db/backends/base/base.py:4002 ms7.5%
BaseDatabaseWrapper._savepointdjango/db/backends/base/base.py:3672 ms7.5%
CursorWrapper.executedjango/db/backends/utils.py:792 ms7.5%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:922 ms7.5%
CursorWrapper._executedjango/db/backends/utils.py:1032 ms7.5%
Cursor.executepsycopg/cursor.py:1132 ms7.5%
Connection.waitpsycopg/connection.py:4952 ms7.5%
BaseCursor._execute_genpsycopg/_cursor_base.py:2062 ms7.5%
BaseCursor._maybe_prepare_genpsycopg/_cursor_base.py:2862 ms7.5%
ClientCursorMixin._execute_sendpsycopg/client_cursor.py:782 ms7.5%
TransactionTestCase._post_teardowndjango/test/testcases.py:1240 self._fixture_teardown()2 ms7.5%
TestCase._fixture_teardowndjango/test/testcases.py:14952 ms7.5%
DatabaseWrapper.check_constraintsdjango/db/backends/postgresql/base.py:4832 ms7.5%
CursorWrapper.executedjango/db/backends/utils.py:792 ms7.5%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:922 ms7.5%
CursorWrapper._executedjango/db/backends/utils.py:1032 ms7.5%
Cursor.executepsycopg/cursor.py:1132 ms7.5%
Connection.waitpsycopg/connection.py:4952 ms7.5%
Estimated from 13 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
18 ms
apps/api/urls.py:56
.filter(Q(date_last_used__lt=now - TOKEN_TOUCH_INTERVAL) | Q(date_last_used=None), token=token)
touch_token · Database
4 ms
apps/api/urls.py:73
touch_token(request.headers.get("Authorization"))
api_request.<locals>.decorator.<locals>.wrapped_view · Database
2 ms

Fixtures

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

Database

11 queries · 2 ms
No repeated queries.

Biggest pieces of work

call test body
apps/api/tests.py:590
24 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 26 ms cb18ed3 main Profile
2 weeks, 4 days ago CI github-actions:test passed 48 ms 9bd5864 main Profile
2 weeks, 6 days ago CI github-actions:test passed 19 ms 19dac9b main Profile
3 weeks ago CI github-actions:test passed 46 ms e141198 main Profile
1 month ago CI github-actions:test passed 24 ms 46ec2aa main Profile
1 month ago CI github-actions:test passed 43 ms afde85b main Profile
1 month ago CI github-actions:test passed 26 ms fe29f9d main Profile
1 month ago CI github-actions:test passed 58 ms 044719a main Profile
1 month ago CI github-actions:test passed 25 ms b3fedae main Profile
1 month, 1 week ago CI github-actions:test passed 61 ms 43c4eda main Profile
1 month, 1 week ago CI github-actions:test passed 40 ms 9caa567 main Profile
1 month, 1 week ago CI github-actions:test passed 38 ms ec75501 main Profile
1 month, 1 week ago CI github-actions:test passed 51 ms d2c12e5 main Profile
1 month, 1 week ago CI github-actions:test passed 24 ms 0b902f6 main Profile
1 month, 1 week ago CI github-actions:test passed 38 ms 78a4357 main Profile