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

ProfileUploadTest::test_reject_missing_run

First seen 3 weeks ago in 78a4357
CI github-actions:test 12 runs
Average
35 ms
median 39 ms
max 46 ms
Phases
Setup 0.69 ms Call 35 ms Teardown 0.15 ms
Categories
Database 8 ms App code 0.17 ms Other (Libraries, Unsampled, pytest, Logging) 27 ms

10 database queries per run

Needs 287 KB of memory (max 808 KB)

Duration per run

Where the time goes

Latest run in ci:github-actions:test, 16 hours ago · open run
Show pytest frames
call45 ms98.1%
ProfileUploadTest.test_reject_missing_runapps/api/tests.py:596 response = self.upload({"format": "flakytest-profile"})45 ms98.1%
ProfileUploadTest.uploadapps/api/tests.py:487 response = self.client.post(45 ms98.1%
Client.postdjango/test/client.py:115345 ms98.1%
RequestFactory.postdjango/test/client.py:49945 ms98.1%
RequestFactory.genericdjango/test/client.py:67145 ms98.1%
Client.requestdjango/test/client.py:108245 ms98.1%
ClientHandler.__call__django/test/client.py:18629 ms64.0%
BaseHandler.get_responsedjango/core/handlers/base.py:14129 ms64.0%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5529 ms64.0%
DebugToolbarMiddleware.__call__debug_toolbar/middleware.py:13029 ms64.0%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5529 ms64.0%
MiddlewareMixin.__call__django/utils/deprecation.py:30929 ms64.0%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5529 ms64.0%
WhiteNoiseMiddleware.__call__whitenoise/middleware.py:12329 ms64.0%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5529 ms64.0%
MiddlewareMixin.__call__django/utils/deprecation.py:30929 ms64.0%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5529 ms64.0%
MiddlewareMixin.__call__django/utils/deprecation.py:30929 ms64.0%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5529 ms64.0%
MiddlewareMixin.__call__django/utils/deprecation.py:30929 ms64.0%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5529 ms64.0%
MiddlewareMixin.__call__django/utils/deprecation.py:30929 ms64.0%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5529 ms64.0%
MiddlewareMixin.__call__django/utils/deprecation.py:30929 ms64.0%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5529 ms64.0%
MiddlewareMixin.__call__django/utils/deprecation.py:30929 ms64.0%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5529 ms64.0%
AccountMiddleware.<locals>.middlewareallauth/account/middleware.py:3429 ms64.0%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5529 ms64.0%
BaseHandler._get_responsedjango/core/handlers/base.py:19829 ms64.0%
csrf_exempt.<locals>._view_wrapperdjango/views/decorators/csrf.py:6529 ms64.0%
jsonify_errors.<locals>.wrapped_viewapps/api/urls.py:3729 ms64.0%
require_http_methods.<locals>.decorator.<locals>.innerdjango/views/decorators/http.py:6429 ms64.0%
api_request.<locals>.decorator.<locals>.wrapped_viewapps/api/urls.py:73 touch_token(request.headers.get("Authorization"))29 ms64.0%
touch_tokenapps/api/urls.py:59 SecretTokens.objects.filter(pk__in=list(stale)).update(date_last_used=now)23 ms51.2%
QuerySet.updatedjango/db/models/query.py:130016 ms34.1%
SQLUpdateCompiler.execute_sqldjango/db/models/sql/compiler.py:211116 ms34.1%
SQLCompiler.execute_sqldjango/db/models/sql/compiler.py:162412 ms25.6%
CursorWrapper.executedjango/db/backends/utils.py:7912 ms25.6%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:9212 ms25.6%
CursorWrapper._executedjango/db/backends/utils.py:10512 ms25.6%
Cursor.executepsycopg/cursor.py:11312 ms25.6%
Connection.waitpsycopg/connection.py:49512 ms25.6%
BaseCursor._execute_genpsycopg/_cursor_base.py:20612 ms25.6%
BaseCursor._maybe_prepare_genpsycopg/_cursor_base.py:28612 ms25.6%
ClientCursorMixin._execute_sendpsycopg/client_cursor.py:7812 ms25.6%
SQLCompiler.execute_sqldjango/db/models/sql/compiler.py:16112 ms4.3%
SQLUpdateCompiler.as_sqldjango/db/models/sql/compiler.py:20782 ms4.3%
SQLCompiler.execute_sqldjango/db/models/sql/compiler.py:16222 ms4.3%
async_unsafe.<locals>.decorator.<locals>.innerdjango/utils/asyncio.py:262 ms4.3%
QuerySet.__iter__django/db/models/query.py:3908 ms17.1%
QuerySet._fetch_alldjango/db/models/query.py:20008 ms17.1%
FlatValuesListIterable.__iter__django/db/models/query.py:2778 ms17.1%
SQLCompiler.results_iterdjango/db/models/sql/compiler.py:15738 ms17.1%
SQLCompiler.execute_sqldjango/db/models/sql/compiler.py:16244 ms8.5%
CursorWrapper.executedjango/db/backends/utils.py:794 ms8.5%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:924 ms8.5%
CursorWrapper._executedjango/db/backends/utils.py:1052 ms4.3%
Cursor.executepsycopg/cursor.py:1132 ms4.3%
Connection.waitpsycopg/connection.py:4952 ms4.3%
BaseCursor._execute_genpsycopg/_cursor_base.py:2062 ms4.3%
BaseCursor._maybe_prepare_genpsycopg/_cursor_base.py:2862 ms4.3%
ClientCursorMixin._execute_sendpsycopg/client_cursor.py:782 ms4.3%
SQLCompiler.execute_sqldjango/db/models/sql/compiler.py:16112 ms4.3%
SQLCompiler.as_sqldjango/db/models/sql/compiler.py:7952 ms4.3%
SQLCompiler.compiledjango/db/models/sql/compiler.py:5782 ms4.3%
WhereNode.as_sqldjango/db/models/sql/where.py:1512 ms4.3%
SQLCompiler.compiledjango/db/models/sql/compiler.py:5782 ms4.3%
WhereNode.as_sqldjango/db/models/sql/where.py:1512 ms4.3%
SQLCompiler.compiledjango/db/models/sql/compiler.py:5782 ms4.3%
BuiltinLookup.as_sqldjango/db/models/lookups.py:2382 ms4.3%
BuiltinLookup.process_lhsdjango/db/models/lookups.py:2302 ms4.3%
Lookup.process_lhsdjango/db/models/lookups.py:1092 ms4.3%
BaseExpression.resolve_expressiondjango/db/models/expressions.py:2972 ms4.3%
BaseExpression.copydjango/db/models/expressions.py:4442 ms4.3%
copy<stdlib>/copy.py:1002 ms4.3%
_reconstruct<stdlib>/copy.py:2632 ms4.3%
SQLCompiler.execute_sqldjango/db/models/sql/compiler.py:16222 ms4.3%
async_unsafe.<locals>.decorator.<locals>.innerdjango/utils/asyncio.py:262 ms4.3%
BaseDatabaseWrapper.cursordjango/db/backends/base/base.py:3202 ms4.3%
BaseDatabaseWrapper._cursordjango/db/backends/base/base.py:2982 ms4.3%
async_unsafe.<locals>.decorator.<locals>.innerdjango/utils/asyncio.py:262 ms4.3%
DatabaseWrapper.create_cursordjango/db/backends/postgresql/base.py:4302 ms4.3%
touch_tokenapps/api/urls.py:55 SecretTokens.objects.select_for_update(skip_locked=True)2 ms4.3%
touch_tokenapps/api/urls.py:56 .filter(Q(date_last_used__lt=now - TOKEN_TOUCH_INTERVAL) | Q(date_last_used=None), token=token)2 ms4.3%
QuerySet.filterdjango/db/models/query.py:15422 ms4.3%
QuerySet._filter_or_excludedjango/db/models/query.py:15602 ms4.3%
QuerySet._filter_or_exclude_inplacedjango/db/models/query.py:15702 ms4.3%
Query.add_qdjango/db/models/sql/query.py:16712 ms4.3%
touch_tokenapps/api/urls.py:57 .values_list("pk", flat=True)2 ms4.3%
QuerySet.values_listdjango/db/models/query.py:14582 ms4.3%
QuerySet._valuesdjango/db/models/query.py:14092 ms4.3%
Query.set_valuesdjango/db/models/sql/query.py:25482 ms4.3%
Query.check_aliasdjango/db/models/sql/query.py:12292 ms4.3%
ClientHandler.__call__django/test/client.py:17316 ms34.1%
BaseHandler.load_middlewaredjango/core/handlers/base.py:6216 ms34.1%
WhiteNoiseMiddleware.__init__whitenoise/middleware.py:10416 ms34.1%
WhiteNoise.add_fileswhitenoise/base.py:10816 ms34.1%
WhiteNoise.update_files_dictionarywhitenoise/base.py:12012 ms25.6%
WhiteNoise.add_file_to_dictionarywhitenoise/base.py:13112 ms25.6%
WhiteNoise.get_static_filewhitenoise/base.py:2088 ms17.1%
StaticFile.__init__whitenoise/responders.py:744 ms8.5%
parsedate<stdlib>/email/_parseaddr.py:1852 ms4.3%
Headers.__getitem__<stdlib>/wsgiref/headers.py:832 ms4.3%
StaticFile.__init__whitenoise/responders.py:722 ms4.3%
StaticFile.get_file_statswhitenoise/responders.py:1612 ms4.3%
__init____init__:-12 ms4.3%
FileEntry.__init__whitenoise/responders.py:2632 ms4.3%
FileEntry.stat_regular_filewhitenoise/responders.py:2762 ms4.3%
<GC>~2 ms4.3%
StaticFile.__init__whitenoise/responders.py:772 ms4.3%
StaticFile.get_alternativeswhitenoise/responders.py:2002 ms4.3%
WhiteNoise.get_static_filewhitenoise/base.py:2032 ms4.3%
WhiteNoise.add_cache_headerswhitenoise/base.py:2242 ms4.3%
WhiteNoiseMiddleware.immutable_file_testwhitenoise/middleware.py:1762 ms4.3%
WhiteNoiseMiddleware.get_static_urlwhitenoise/middleware.py:1972 ms4.3%
URLMixin.urldebug_toolbar/panels/staticfiles.py:202 ms4.3%
WhiteNoise.get_static_filewhitenoise/base.py:2022 ms4.3%
WhiteNoise.update_files_dictionarywhitenoise/base.py:1154 ms8.5%
scantreewhitenoise/base.py:2602 ms4.3%
scantreewhitenoise/base.py:2622 ms4.3%
scantreewhitenoise/base.py:2622 ms4.3%
scantreewhitenoise/base.py:2622 ms4.3%
scantreewhitenoise/base.py:2622 ms4.3%
Estimated from 23 samples; phase durations are exact. Frames from pytest and pluggy are hidden .

Hot lines in your code

apps/api/urls.py:59
SecretTokens.objects.filter(pk__in=list(stale)).update(date_last_used=now)
touch_token · Database
23 ms
apps/api/tests.py:487
response = self.client.post(
ProfileUploadTest.upload · Libraries
16 ms
apps/api/urls.py:55
SecretTokens.objects.select_for_update(skip_locked=True)
touch_token · App code
2 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
2 ms
apps/api/urls.py:57
.values_list("pk", flat=True)
touch_token · Database
2 ms

Fixtures

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

Database

10 queries · 2 ms
No repeated queries.

Biggest pieces of work

call test body
apps/api/tests.py:596
45 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 46 ms e141198 main Profile
1 week, 5 days ago CI github-actions:test passed 23 ms 46ec2aa main Profile
2 weeks, 1 day ago CI github-actions:test passed 41 ms afde85b main Profile
2 weeks, 1 day ago CI github-actions:test passed 29 ms fe29f9d main Profile
2 weeks, 1 day ago CI github-actions:test passed 39 ms 044719a main Profile
2 weeks, 2 days ago CI github-actions:test passed 24 ms b3fedae main Profile
2 weeks, 4 days ago CI github-actions:test passed 40 ms 43c4eda main Profile
2 weeks, 6 days ago CI github-actions:test passed 41 ms 9caa567 main Profile
2 weeks, 6 days ago CI github-actions:test passed 37 ms ec75501 main Profile
3 weeks ago CI github-actions:test passed 41 ms d2c12e5 main Profile
3 weeks ago CI github-actions:test passed 25 ms 0b902f6 main Profile
3 weeks ago CI github-actions:test passed 38 ms 78a4357 main Profile