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

IngestEnvironmentTest::test_old_client_on_unknown_ci

First seen 1 month, 1 week ago in 78a4357
CI github-actions:test 15 runs
Average
48 ms
median 51 ms
max 77 ms
Phases
Setup 0.67 ms Call 47 ms Teardown 0.16 ms
Categories
Database 21 ms App code 0.41 ms Other (Libraries, Unsampled, pytest) 26 ms

34 database queries per run

Needs 0 KB of memory (max 0 KB)

Duration per run

Where the time goes

Latest run in ci:github-actions:test, 2 weeks ago · open run
Show pytest frames
call37 ms98.2%
IngestEnvironmentTest.test_old_client_on_unknown_ciapps/api/tests.py:406 session = self.ingest_start({"env": {"CI": "true"}})35 ms92.8%
IngestEnvironmentTest.ingest_startapps/api/tests.py:352 response = self.client.post(33 ms87.3%
Client.postdjango/test/client.py:115333 ms87.3%
RequestFactory.postdjango/test/client.py:49933 ms87.3%
RequestFactory.genericdjango/test/client.py:67133 ms87.3%
Client.requestdjango/test/client.py:108233 ms87.3%
ClientHandler.__call__django/test/client.py:17319 ms49.1%
BaseHandler.load_middlewaredjango/core/handlers/base.py:6219 ms49.1%
WhiteNoiseMiddleware.__init__whitenoise/middleware.py:10419 ms49.1%
WhiteNoise.add_fileswhitenoise/base.py:10819 ms49.1%
WhiteNoise.update_files_dictionarywhitenoise/base.py:12015 ms38.2%
WhiteNoise.add_file_to_dictionarywhitenoise/base.py:13115 ms38.2%
WhiteNoise.get_static_filewhitenoise/base.py:20810 ms27.3%
StaticFile.__init__whitenoise/responders.py:734 ms10.9%
StaticFile.get_headerswhitenoise/responders.py:1702 ms5.5%
StaticFile.get_headerswhitenoise/responders.py:1762 ms5.5%
formatdate<stdlib>/email/utils.py:2662 ms5.5%
StaticFile.__init__whitenoise/responders.py:772 ms5.5%
StaticFile.get_alternativeswhitenoise/responders.py:2032 ms5.5%
Headers.__setitem__<stdlib>/wsgiref/headers.py:642 ms5.5%
StaticFile.__init__whitenoise/responders.py:722 ms5.5%
StaticFile.get_file_statswhitenoise/responders.py:1612 ms5.5%
WhiteNoise.get_static_filewhitenoise/base.py:2022 ms5.5%
WhiteNoise.add_mime_headerswhitenoise/base.py:2212 ms5.5%
WhiteNoise.get_static_filewhitenoise/base.py:2012 ms5.5%
__init____init__:-12 ms5.5%
WhiteNoise.update_files_dictionarywhitenoise/base.py:1154 ms10.9%
scantreewhitenoise/base.py:2624 ms10.9%
scantreewhitenoise/base.py:2624 ms10.9%
scantreewhitenoise/base.py:2644 ms10.9%
ClientHandler.__call__django/test/client.py:18615 ms38.2%
BaseHandler.get_responsedjango/core/handlers/base.py:14115 ms38.2%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5515 ms38.2%
DebugToolbarMiddleware.__call__debug_toolbar/middleware.py:13015 ms38.2%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5515 ms38.2%
MiddlewareMixin.__call__django/utils/deprecation.py:30915 ms38.2%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5515 ms38.2%
WhiteNoiseMiddleware.__call__whitenoise/middleware.py:12315 ms38.2%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5515 ms38.2%
MiddlewareMixin.__call__django/utils/deprecation.py:30915 ms38.2%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5515 ms38.2%
MiddlewareMixin.__call__django/utils/deprecation.py:30915 ms38.2%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5515 ms38.2%
MiddlewareMixin.__call__django/utils/deprecation.py:30915 ms38.2%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5515 ms38.2%
MiddlewareMixin.__call__django/utils/deprecation.py:30915 ms38.2%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5515 ms38.2%
MiddlewareMixin.__call__django/utils/deprecation.py:30915 ms38.2%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5515 ms38.2%
MiddlewareMixin.__call__django/utils/deprecation.py:30915 ms38.2%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5515 ms38.2%
AccountMiddleware.<locals>.middlewareallauth/account/middleware.py:3415 ms38.2%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5515 ms38.2%
BaseHandler._get_responsedjango/core/handlers/base.py:19815 ms38.2%
csrf_exempt.<locals>._view_wrapperdjango/views/decorators/csrf.py:6515 ms38.2%
jsonify_errors.<locals>.wrapped_viewapps/api/urls.py:3715 ms38.2%
require_http_methods.<locals>.decorator.<locals>.innerdjango/views/decorators/http.py:6415 ms38.2%
api_request.<locals>.decorator.<locals>.wrapped_viewapps/api/urls.py:75 return view_func(request, *args, **kwargs)8 ms21.8%
ingest_startapps/api/urls.py:100 process_ingest_start(ingest.id)6 ms16.4%
_SharedTaskProxy.__call__potatoq/app.py:7636 ms16.4%
Task.__call__potatoq/task.py:1896 ms16.4%
process_ingest_startapps/api/tasks.py:53 ingest = Ingest.objects.only("id").select_for_update().get(id=ingest_id)2 ms5.5%
QuerySet.getdjango/db/models/query.py:6352 ms5.5%
QuerySet.__len__django/db/models/query.py:3722 ms5.5%
QuerySet._fetch_alldjango/db/models/query.py:20002 ms5.5%
ModelIterable.__iter__django/db/models/query.py:952 ms5.5%
SQLCompiler.execute_sqldjango/db/models/sql/compiler.py:16112 ms5.5%
SQLCompiler.as_sqldjango/db/models/sql/compiler.py:7672 ms5.5%
SQLCompiler.pre_sql_setupdjango/db/models/sql/compiler.py:862 ms5.5%
SQLCompiler.setup_querydjango/db/models/sql/compiler.py:752 ms5.5%
SQLCompiler.get_selectdjango/db/models/sql/compiler.py:2552 ms5.5%
SQLCompiler.get_default_columnsdjango/db/models/sql/compiler.py:10272 ms5.5%
process_ingest_startapps/api/tasks.py:772 ms5.5%
get_or_create_numberedapps/projects/models.py:24 return model.objects.create(project=project, number=number, **lookup, **(defaults or {})), True2 ms5.5%
BaseManager._get_queryset_methods.<locals>.create_method.<locals>.manager_methoddjango/db/models/manager.py:872 ms5.5%
QuerySet.createdjango/db/models/query.py:6692 ms5.5%
Run.saveapps/projects/models.py:188 super().save(*args, **kwargs)2 ms5.5%
Model.savedjango/db/models/base.py:8742 ms5.5%
Model.save_basedjango/db/models/base.py:9662 ms5.5%
Model._save_tabledjango/db/models/base.py:11672 ms5.5%
Model._do_insertdjango/db/models/base.py:12182 ms5.5%
BaseManager._get_queryset_methods.<locals>.create_method.<locals>.manager_methoddjango/db/models/manager.py:872 ms5.5%
QuerySet._insertdjango/db/models/query.py:19182 ms5.5%
SQLInsertCompiler.execute_sqldjango/db/models/sql/compiler.py:19252 ms5.5%
CursorWrapper.executedjango/db/backends/utils.py:792 ms5.5%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:922 ms5.5%
CursorWrapper._executedjango/db/backends/utils.py:1052 ms5.5%
Cursor.executepsycopg/cursor.py:1132 ms5.5%
Connection.waitpsycopg/connection.py:4952 ms5.5%
process_ingest_startapps/api/tasks.py:89 Session.objects.get_or_create(2 ms5.5%
BaseManager._get_queryset_methods.<locals>.create_method.<locals>.manager_methoddjango/db/models/manager.py:872 ms5.5%
QuerySet.get_or_createdjango/db/models/query.py:9942 ms5.5%
QuerySet.createdjango/db/models/query.py:6692 ms5.5%
Model.savedjango/db/models/base.py:8742 ms5.5%
Model.save_basedjango/db/models/base.py:9662 ms5.5%
Model._save_tabledjango/db/models/base.py:11672 ms5.5%
Model._do_insertdjango/db/models/base.py:12182 ms5.5%
BaseManager._get_queryset_methods.<locals>.create_method.<locals>.manager_methoddjango/db/models/manager.py:872 ms5.5%
QuerySet._insertdjango/db/models/query.py:19182 ms5.5%
SQLInsertCompiler.execute_sqldjango/db/models/sql/compiler.py:19352 ms5.5%
BaseDatabaseOperations.fetch_returned_rowsdjango/db/backends/base/operations.py:3782 ms5.5%
ingest_startapps/api/urls.py:95 "muted_tests": [{"name": test.name} for test in muted_tests],2 ms5.5%
QuerySet.__iter__django/db/models/query.py:3902 ms5.5%
QuerySet._fetch_alldjango/db/models/query.py:20002 ms5.5%
ModelIterable.__iter__django/db/models/query.py:952 ms5.5%
SQLCompiler.execute_sqldjango/db/models/sql/compiler.py:16112 ms5.5%
SQLCompiler.as_sqldjango/db/models/sql/compiler.py:7672 ms5.5%
SQLCompiler.pre_sql_setupdjango/db/models/sql/compiler.py:862 ms5.5%
SQLCompiler.setup_querydjango/db/models/sql/compiler.py:752 ms5.5%
api_request.<locals>.decorator.<locals>.wrapped_viewapps/api/urls.py:73 touch_token(request.headers.get("Authorization"))4 ms10.9%
touch_tokenapps/api/urls.py:59 SecretTokens.objects.filter(pk__in=list(stale)).update(date_last_used=now)2 ms5.5%
QuerySet.__iter__django/db/models/query.py:3902 ms5.5%
QuerySet._fetch_alldjango/db/models/query.py:20002 ms5.5%
FlatValuesListIterable.__iter__django/db/models/query.py:2772 ms5.5%
SQLCompiler.results_iterdjango/db/models/sql/compiler.py:15732 ms5.5%
SQLCompiler.execute_sqldjango/db/models/sql/compiler.py:16242 ms5.5%
CursorWrapper.executedjango/db/backends/utils.py:792 ms5.5%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:922 ms5.5%
CursorWrapper._executedjango/db/backends/utils.py:1052 ms5.5%
Cursor.executepsycopg/cursor.py:1132 ms5.5%
Connection.waitpsycopg/connection.py:4952 ms5.5%
Atomic.__exit__django/db/transaction.py:2472 ms5.5%
async_unsafe.<locals>.decorator.<locals>.innerdjango/utils/asyncio.py:262 ms5.5%
BaseDatabaseWrapper.savepoint_commitdjango/db/backends/base/base.py:4312 ms5.5%
BaseDatabaseWrapper._savepoint_commitdjango/db/backends/base/base.py:3752 ms5.5%
CursorWrapper.executedjango/db/backends/utils.py:792 ms5.5%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:922 ms5.5%
CursorWrapper._executedjango/db/backends/utils.py:1032 ms5.5%
Cursor.executepsycopg/cursor.py:1132 ms5.5%
Connection.waitpsycopg/connection.py:4952 ms5.5%
api_request.<locals>.decorator.<locals>.wrapped_viewapps/api/urls.py:72 project = get_object_or_404(Project, secrettokens__token=request.headers.get("Authorization"))2 ms5.5%
get_object_or_404django/shortcuts.py:902 ms5.5%
QuerySet.getdjango/db/models/query.py:6352 ms5.5%
QuerySet.__len__django/db/models/query.py:3722 ms5.5%
QuerySet._fetch_alldjango/db/models/query.py:20002 ms5.5%
ModelIterable.__iter__django/db/models/query.py:952 ms5.5%
SQLCompiler.execute_sqldjango/db/models/sql/compiler.py:16242 ms5.5%
CursorWrapper.executedjango/db/backends/utils.py:792 ms5.5%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:922 ms5.5%
CursorWrapper._executedjango/db/backends/utils.py:1052 ms5.5%
Cursor.executepsycopg/cursor.py:1132 ms5.5%
Connection.waitpsycopg/connection.py:4952 ms5.5%
IngestEnvironmentTest.ingest_startapps/api/tests.py:359 return Session.objects.get(ingest_id=response.json()["ingest_id"])2 ms5.5%
ClientMixin._parse_jsondjango/test/client.py:9522 ms5.5%
IngestEnvironmentTest.test_old_client_on_unknown_ciapps/api/tests.py:407 self.assertEqual(session.environment.name, "ci:unknown")2 ms5.5%
ForwardManyToOneDescriptor.__get__django/db/models/fields/related_descriptors.py:2572 ms5.5%
ForwardManyToOneDescriptor.get_objectdjango/db/models/fields/related_descriptors.py:2222 ms5.5%
QuerySet.getdjango/db/models/query.py:6352 ms5.5%
QuerySet.__len__django/db/models/query.py:3722 ms5.5%
QuerySet._fetch_alldjango/db/models/query.py:20002 ms5.5%
ModelIterable.__iter__django/db/models/query.py:952 ms5.5%
SQLCompiler.execute_sqldjango/db/models/sql/compiler.py:16242 ms5.5%
CursorWrapper.executedjango/db/backends/utils.py:792 ms5.5%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:922 ms5.5%
CursorWrapper._executedjango/db/backends/utils.py:1052 ms5.5%
Cursor.executepsycopg/cursor.py:1132 ms5.5%
Connection.waitpsycopg/connection.py:4952 ms5.5%
Estimated from 18 samples; phase durations are exact. Frames from pytest and pluggy are hidden .

Hot lines in your code

apps/api/tests.py:352
response = self.client.post(
IngestEnvironmentTest.ingest_start · Libraries
19 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/api/urls.py:73
touch_token(request.headers.get("Authorization"))
api_request.<locals>.decorator.<locals>.wrapped_view · Database
2 ms
apps/api/urls.py:95
"muted_tests": [{"name": test.name} for test in muted_tests],
ingest_start · Database
2 ms
apps/api/tasks.py:53
ingest = Ingest.objects.only("id").select_for_update().get(id=ingest_id)
process_ingest_start · Database
2 ms
apps/projects/models.py:188
super().save(*args, **kwargs)
Run.save · Database
2 ms
apps/api/tasks.py:89
Session.objects.get_or_create(
process_ingest_start · Database
2 ms
apps/api/tests.py:359
return Session.objects.get(ingest_id=response.json()["ingest_id"])
IngestEnvironmentTest.ingest_start · Libraries
2 ms
apps/api/tests.py:407
self.assertEqual(session.environment.name, "ci:unknown")
IngestEnvironmentTest.test_old_client_on_unknown_ci · Database
2 ms

Fixtures

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

Database

34 queries · 7 ms
No repeated queries.

Biggest pieces of work

call test body
apps/api/tests.py:406
37 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 38 ms cb18ed3 main Profile
2 weeks, 4 days ago CI github-actions:test passed 56 ms 9bd5864 main Profile
2 weeks, 6 days ago CI github-actions:test passed 34 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 27 ms 46ec2aa main Profile
1 month ago CI github-actions:test passed 51 ms afde85b main Profile
1 month ago CI github-actions:test passed 39 ms fe29f9d main Profile
1 month ago CI github-actions:test passed 56 ms 044719a main Profile
1 month ago CI github-actions:test passed 32 ms b3fedae main Profile
1 month, 1 week ago CI github-actions:test passed 58 ms 43c4eda main Profile
1 month, 1 week ago CI github-actions:test passed 58 ms 9caa567 main Profile
1 month, 1 week ago CI github-actions:test passed 57 ms ec75501 main Profile
1 month, 1 week ago CI github-actions:test passed 77 ms d2c12e5 main Profile
1 month, 1 week ago CI github-actions:test passed 28 ms 0b902f6 main Profile
1 month, 1 week ago CI github-actions:test passed 59 ms 78a4357 main Profile