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

IngestEnvironmentTest::test_old_client_on_github_actions

First seen 3 weeks ago in 78a4357
CI github-actions:test 12 runs
Average
51 ms
median 53 ms
max 81 ms
Phases
Setup 0.74 ms Call 50 ms Teardown 0.16 ms
Categories
Database 23 ms Other (Libraries, Unsampled, pytest) 28 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, 16 hours ago · open run
Show pytest frames
call50 ms98.2%
IngestEnvironmentTest.test_old_client_on_github_actionsapps/api/tests.py:396 session = self.ingest_start(46 ms90.6%
IngestEnvironmentTest.ingest_startapps/api/tests.py:352 response = self.client.post(46 ms90.6%
Client.postdjango/test/client.py:115346 ms90.6%
RequestFactory.postdjango/test/client.py:49946 ms90.6%
RequestFactory.genericdjango/test/client.py:67146 ms90.6%
Client.requestdjango/test/client.py:108246 ms90.6%
ClientHandler.__call__django/test/client.py:18625 ms49.1%
BaseHandler.get_responsedjango/core/handlers/base.py:14125 ms49.1%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5525 ms49.1%
DebugToolbarMiddleware.__call__debug_toolbar/middleware.py:13025 ms49.1%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5525 ms49.1%
MiddlewareMixin.__call__django/utils/deprecation.py:30925 ms49.1%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5525 ms49.1%
WhiteNoiseMiddleware.__call__whitenoise/middleware.py:12325 ms49.1%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5525 ms49.1%
MiddlewareMixin.__call__django/utils/deprecation.py:30925 ms49.1%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5525 ms49.1%
MiddlewareMixin.__call__django/utils/deprecation.py:30925 ms49.1%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5525 ms49.1%
MiddlewareMixin.__call__django/utils/deprecation.py:30925 ms49.1%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5525 ms49.1%
MiddlewareMixin.__call__django/utils/deprecation.py:30925 ms49.1%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5525 ms49.1%
MiddlewareMixin.__call__django/utils/deprecation.py:30925 ms49.1%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5525 ms49.1%
MiddlewareMixin.__call__django/utils/deprecation.py:30925 ms49.1%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5525 ms49.1%
AccountMiddleware.<locals>.middlewareallauth/account/middleware.py:3425 ms49.1%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5525 ms49.1%
BaseHandler._get_responsedjango/core/handlers/base.py:19825 ms49.1%
csrf_exempt.<locals>._view_wrapperdjango/views/decorators/csrf.py:6525 ms49.1%
jsonify_errors.<locals>.wrapped_viewapps/api/urls.py:3725 ms49.1%
require_http_methods.<locals>.decorator.<locals>.innerdjango/views/decorators/http.py:6425 ms49.1%
api_request.<locals>.decorator.<locals>.wrapped_viewapps/api/urls.py:7517 ms34.0%
ingest_startapps/api/urls.py:100 process_ingest_start(ingest.id)15 ms30.2%
_SharedTaskProxy.__call__potatoq/app.py:76315 ms30.2%
Task.__call__potatoq/task.py:18915 ms30.2%
process_ingest_startapps/api/tasks.py:774 ms7.6%
get_or_create_numberedapps/projects/models.py:212 ms3.8%
next_numberapps/projects/models.py:35 return (model.objects.filter(project_id=project_id).aggregate(last=models.Max("number"))["last"] or 0) + 12 ms3.8%
QuerySet.aggregatedjango/db/models/query.py:5942 ms3.8%
Query.get_aggregationdjango/db/models/sql/query.py:6332 ms3.8%
SQLCompiler.execute_sqldjango/db/models/sql/compiler.py:16242 ms3.8%
CursorWrapper.executedjango/db/backends/utils.py:792 ms3.8%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:922 ms3.8%
CursorWrapper._executedjango/db/backends/utils.py:1052 ms3.8%
Cursor.executepsycopg/cursor.py:1132 ms3.8%
Connection.waitpsycopg/connection.py:4952 ms3.8%
get_or_create_numberedapps/projects/models.py:24 return model.objects.create(project=project, number=number, **lookup, **(defaults or {})), True2 ms3.8%
BaseManager._get_queryset_methods.<locals>.create_method.<locals>.manager_methoddjango/db/models/manager.py:872 ms3.8%
QuerySet.createdjango/db/models/query.py:6692 ms3.8%
Run.saveapps/projects/models.py:188 super().save(*args, **kwargs)2 ms3.8%
Model.savedjango/db/models/base.py:8742 ms3.8%
Model.save_basedjango/db/models/base.py:9662 ms3.8%
Model._save_tabledjango/db/models/base.py:11672 ms3.8%
Model._do_insertdjango/db/models/base.py:12182 ms3.8%
BaseManager._get_queryset_methods.<locals>.create_method.<locals>.manager_methoddjango/db/models/manager.py:872 ms3.8%
QuerySet._insertdjango/db/models/query.py:19182 ms3.8%
SQLInsertCompiler.execute_sqldjango/db/models/sql/compiler.py:19252 ms3.8%
CursorWrapper.executedjango/db/backends/utils.py:792 ms3.8%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:922 ms3.8%
CursorWrapper._executedjango/db/backends/utils.py:1052 ms3.8%
Cursor.executepsycopg/cursor.py:1132 ms3.8%
Connection.waitpsycopg/connection.py:4952 ms3.8%
process_ingest_startapps/api/tasks.py:89 Session.objects.get_or_create(4 ms7.6%
BaseManager._get_queryset_methods.<locals>.create_method.<locals>.manager_methoddjango/db/models/manager.py:874 ms7.6%
QuerySet.get_or_createdjango/db/models/query.py:9872 ms3.8%
QuerySet.getdjango/db/models/query.py:6352 ms3.8%
QuerySet.__len__django/db/models/query.py:3722 ms3.8%
QuerySet._fetch_alldjango/db/models/query.py:20002 ms3.8%
ModelIterable.__iter__django/db/models/query.py:952 ms3.8%
SQLCompiler.execute_sqldjango/db/models/sql/compiler.py:16242 ms3.8%
CursorWrapper.executedjango/db/backends/utils.py:792 ms3.8%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:922 ms3.8%
CursorWrapper._executedjango/db/backends/utils.py:1052 ms3.8%
Cursor.executepsycopg/cursor.py:1132 ms3.8%
Connection.waitpsycopg/connection.py:4952 ms3.8%
QuerySet.get_or_createdjango/db/models/query.py:9942 ms3.8%
QuerySet.createdjango/db/models/query.py:6692 ms3.8%
Model.savedjango/db/models/base.py:8742 ms3.8%
Model.save_basedjango/db/models/base.py:9662 ms3.8%
Model._save_tabledjango/db/models/base.py:11672 ms3.8%
Model._do_insertdjango/db/models/base.py:12182 ms3.8%
BaseManager._get_queryset_methods.<locals>.create_method.<locals>.manager_methoddjango/db/models/manager.py:872 ms3.8%
QuerySet._insertdjango/db/models/query.py:19182 ms3.8%
SQLInsertCompiler.execute_sqldjango/db/models/sql/compiler.py:19252 ms3.8%
CursorWrapper.executedjango/db/backends/utils.py:792 ms3.8%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:922 ms3.8%
CursorWrapper._executedjango/db/backends/utils.py:1052 ms3.8%
Cursor.executepsycopg/cursor.py:1132 ms3.8%
Connection.waitpsycopg/connection.py:4952 ms3.8%
Atomic.__enter__django/db/transaction.py:2112 ms3.8%
async_unsafe.<locals>.decorator.<locals>.innerdjango/utils/asyncio.py:262 ms3.8%
BaseDatabaseWrapper.savepointdjango/db/backends/base/base.py:3992 ms3.8%
BaseDatabaseWrapper.validate_thread_sharingdjango/db/backends/base/base.py:6442 ms3.8%
process_ingest_startapps/api/tasks.py:54 data = ingest.data2 ms3.8%
DeferredAttribute.__get__django/db/models/query_utils.py:2712 ms3.8%
Model.refresh_from_dbdjango/db/models/base.py:7582 ms3.8%
QuerySet.getdjango/db/models/query.py:6352 ms3.8%
QuerySet.__len__django/db/models/query.py:3722 ms3.8%
QuerySet._fetch_alldjango/db/models/query.py:20002 ms3.8%
ModelIterable.__iter__django/db/models/query.py:952 ms3.8%
SQLCompiler.execute_sqldjango/db/models/sql/compiler.py:16112 ms3.8%
SQLCompiler.as_sqldjango/db/models/sql/compiler.py:7952 ms3.8%
SQLCompiler.compiledjango/db/models/sql/compiler.py:5782 ms3.8%
process_ingest_startapps/api/tasks.py:842 ms3.8%
get_or_create_environmentapps/projects/environments.py:63 obj, created = Environment.objects.get_or_create(2 ms3.8%
BaseManager._get_queryset_methods.<locals>.create_method.<locals>.manager_methoddjango/db/models/manager.py:872 ms3.8%
QuerySet.get_or_createdjango/db/models/query.py:9942 ms3.8%
QuerySet.createdjango/db/models/query.py:6692 ms3.8%
Model.savedjango/db/models/base.py:8742 ms3.8%
Model.save_basedjango/db/models/base.py:9662 ms3.8%
Model._save_tabledjango/db/models/base.py:11672 ms3.8%
Model._do_insertdjango/db/models/base.py:12182 ms3.8%
BaseManager._get_queryset_methods.<locals>.create_method.<locals>.manager_methoddjango/db/models/manager.py:872 ms3.8%
QuerySet._insertdjango/db/models/query.py:19182 ms3.8%
SQLInsertCompiler.execute_sqldjango/db/models/sql/compiler.py:19252 ms3.8%
CursorWrapper.executedjango/db/backends/utils.py:792 ms3.8%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:922 ms3.8%
CursorWrapper._executedjango/db/backends/utils.py:1052 ms3.8%
Cursor.executepsycopg/cursor.py:1132 ms3.8%
Connection.waitpsycopg/connection.py:4952 ms3.8%
process_ingest_startapps/api/tasks.py:105 ingest.save(update_fields=["date_processed"])2 ms3.8%
Model.savedjango/db/models/base.py:8742 ms3.8%
Model.save_basedjango/db/models/base.py:9662 ms3.8%
Model._save_tabledjango/db/models/base.py:11102 ms3.8%
Model._do_updatedjango/db/models/base.py:12112 ms3.8%
QuerySet._updatedjango/db/models/query.py:13272 ms3.8%
SQLUpdateCompiler.execute_returning_sqldjango/db/models/sql/compiler.py:21402 ms3.8%
SQLUpdateCompiler.execute_sqldjango/db/models/sql/compiler.py:21112 ms3.8%
SQLCompiler.execute_sqldjango/db/models/sql/compiler.py:16242 ms3.8%
CursorWrapper.executedjango/db/backends/utils.py:792 ms3.8%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:922 ms3.8%
CursorWrapper._executedjango/db/backends/utils.py:1052 ms3.8%
Cursor.executepsycopg/cursor.py:1132 ms3.8%
Connection.waitpsycopg/connection.py:4952 ms3.8%
ingest_startapps/api/urls.py:91 muted_tests = Test.objects.filter(project=project, mute__date_unmuted__isnull=True, mute__until__gte=timezone.now())2 ms3.8%
BaseManager._get_queryset_methods.<locals>.create_method.<locals>.manager_methoddjango/db/models/manager.py:872 ms3.8%
QuerySet.filterdjango/db/models/query.py:15422 ms3.8%
QuerySet._filter_or_excludedjango/db/models/query.py:15602 ms3.8%
QuerySet._filter_or_exclude_inplacedjango/db/models/query.py:15702 ms3.8%
Query.add_qdjango/db/models/sql/query.py:16712 ms3.8%
Query._add_qdjango/db/models/sql/query.py:17032 ms3.8%
Query.build_filterdjango/db/models/sql/query.py:16132 ms3.8%
Query.build_lookupdjango/db/models/sql/query.py:14302 ms3.8%
api_request.<locals>.decorator.<locals>.wrapped_viewapps/api/urls.py:73 touch_token(request.headers.get("Authorization"))6 ms11.3%
Atomic.__enter__django/db/transaction.py:1832 ms3.8%
get_connectiondjango/db/transaction.py:252 ms3.8%
BaseConnectionHandler.__getitem__django/utils/connection.py:582 ms3.8%
touch_tokenapps/api/urls.py:59 SecretTokens.objects.filter(pk__in=list(stale)).update(date_last_used=now)2 ms3.8%
QuerySet.__iter__django/db/models/query.py:3902 ms3.8%
QuerySet._fetch_alldjango/db/models/query.py:20002 ms3.8%
FlatValuesListIterable.__iter__django/db/models/query.py:2772 ms3.8%
SQLCompiler.results_iterdjango/db/models/sql/compiler.py:15732 ms3.8%
SQLCompiler.execute_sqldjango/db/models/sql/compiler.py:16242 ms3.8%
CursorWrapper.executedjango/db/backends/utils.py:792 ms3.8%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:922 ms3.8%
CursorWrapper._executedjango/db/backends/utils.py:1052 ms3.8%
Cursor.executepsycopg/cursor.py:1132 ms3.8%
Connection.waitpsycopg/connection.py:4952 ms3.8%
Atomic.__exit__django/db/transaction.py:2472 ms3.8%
async_unsafe.<locals>.decorator.<locals>.innerdjango/utils/asyncio.py:262 ms3.8%
BaseDatabaseWrapper.savepoint_commitdjango/db/backends/base/base.py:4312 ms3.8%
BaseDatabaseWrapper._savepoint_commitdjango/db/backends/base/base.py:3752 ms3.8%
CursorWrapper.executedjango/db/backends/utils.py:792 ms3.8%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:922 ms3.8%
CursorWrapper._executedjango/db/backends/utils.py:1032 ms3.8%
Cursor.executepsycopg/cursor.py:1132 ms3.8%
Connection.waitpsycopg/connection.py:4952 ms3.8%
api_request.<locals>.decorator.<locals>.wrapped_viewapps/api/urls.py:72 project = get_object_or_404(Project, secrettokens__token=request.headers.get("Authorization"))2 ms3.8%
get_object_or_404django/shortcuts.py:902 ms3.8%
QuerySet.getdjango/db/models/query.py:6352 ms3.8%
QuerySet.__len__django/db/models/query.py:3722 ms3.8%
QuerySet._fetch_alldjango/db/models/query.py:20002 ms3.8%
ModelIterable.__iter__django/db/models/query.py:952 ms3.8%
SQLCompiler.execute_sqldjango/db/models/sql/compiler.py:16112 ms3.8%
SQLCompiler.as_sqldjango/db/models/sql/compiler.py:7672 ms3.8%
SQLCompiler.pre_sql_setupdjango/db/models/sql/compiler.py:862 ms3.8%
SQLCompiler.setup_querydjango/db/models/sql/compiler.py:752 ms3.8%
SQLCompiler.get_selectdjango/db/models/sql/compiler.py:3172 ms3.8%
SQLCompiler.compiledjango/db/models/sql/compiler.py:5782 ms3.8%
Col.as_sqldjango/db/models/expressions.py:13232 ms3.8%
ClientHandler.__call__django/test/client.py:17321 ms41.5%
BaseHandler.load_middlewaredjango/core/handlers/base.py:6221 ms41.5%
WhiteNoiseMiddleware.__init__whitenoise/middleware.py:10419 ms37.8%
WhiteNoise.add_fileswhitenoise/base.py:10819 ms37.8%
WhiteNoise.update_files_dictionarywhitenoise/base.py:12017 ms34.0%
WhiteNoise.add_file_to_dictionarywhitenoise/base.py:13117 ms34.0%
WhiteNoise.get_static_filewhitenoise/base.py:2038 ms15.1%
WhiteNoise.add_cache_headerswhitenoise/base.py:2248 ms15.1%
WhiteNoiseMiddleware.immutable_file_testwhitenoise/middleware.py:1768 ms15.1%
WhiteNoiseMiddleware.get_static_urlwhitenoise/middleware.py:1978 ms15.1%
URLMixin.urldebug_toolbar/panels/staticfiles.py:218 ms15.1%
<GC>~8 ms15.1%
WhiteNoise.get_static_filewhitenoise/base.py:2088 ms15.1%
StaticFile.__init__whitenoise/responders.py:774 ms7.6%
StaticFile.get_alternativeswhitenoise/responders.py:2004 ms7.6%
__init____init__:-12 ms3.8%
StaticFile.__init__whitenoise/responders.py:732 ms3.8%
StaticFile.get_headerswhitenoise/responders.py:1762 ms3.8%
formatdate<stdlib>/email/utils.py:2662 ms3.8%
StaticFile.__init__whitenoise/responders.py:762 ms3.8%
StaticFile.get_not_modified_responsewhitenoise/responders.py:1892 ms3.8%
Headers.__getitem__<stdlib>/wsgiref/headers.py:832 ms3.8%
Headers.get<stdlib>/wsgiref/headers.py:1042 ms3.8%
WhiteNoise.get_static_filewhitenoise/base.py:2022 ms3.8%
WhiteNoise.update_files_dictionarywhitenoise/base.py:1152 ms3.8%
scantreewhitenoise/base.py:2622 ms3.8%
scantreewhitenoise/base.py:2622 ms3.8%
scantreewhitenoise/base.py:2622 ms3.8%
scantreewhitenoise/base.py:2622 ms3.8%
scantreewhitenoise/base.py:2622 ms3.8%
scantreewhitenoise/base.py:2642 ms3.8%
WhiteNoiseMiddleware.__init__whitenoise/middleware.py:1112 ms3.8%
WhiteNoise.add_fileswhitenoise/base.py:1082 ms3.8%
WhiteNoise.update_files_dictionarywhitenoise/base.py:1202 ms3.8%
WhiteNoise.add_file_to_dictionarywhitenoise/base.py:1312 ms3.8%
WhiteNoise.get_static_filewhitenoise/base.py:2082 ms3.8%
StaticFile.__init__whitenoise/responders.py:732 ms3.8%
StaticFile.get_headerswhitenoise/responders.py:1782 ms3.8%
IngestEnvironmentTest.test_old_client_on_github_actionsapps/api/tests.py:399 self.assertEqual(session.environment.name, "ci:github-actions")2 ms3.8%
ForwardManyToOneDescriptor.__get__django/db/models/fields/related_descriptors.py:2572 ms3.8%
ForwardManyToOneDescriptor.get_objectdjango/db/models/fields/related_descriptors.py:2222 ms3.8%
QuerySet.getdjango/db/models/query.py:6352 ms3.8%
QuerySet.__len__django/db/models/query.py:3722 ms3.8%
QuerySet._fetch_alldjango/db/models/query.py:20002 ms3.8%
ModelIterable.__iter__django/db/models/query.py:952 ms3.8%
SQLCompiler.execute_sqldjango/db/models/sql/compiler.py:16242 ms3.8%
CursorWrapper.executedjango/db/backends/utils.py:792 ms3.8%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:922 ms3.8%
TransactionTestCase._post_teardowndjango/test/testcases.py:1240 self._fixture_teardown()2 ms3.8%
TestCase._fixture_teardowndjango/test/testcases.py:14952 ms3.8%
DatabaseWrapper.check_constraintsdjango/db/backends/postgresql/base.py:4842 ms3.8%
CursorWrapper.executedjango/db/backends/utils.py:792 ms3.8%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:922 ms3.8%
CursorWrapper._executedjango/db/backends/utils.py:1032 ms3.8%
Cursor.executepsycopg/cursor.py:1132 ms3.8%
Connection.waitpsycopg/connection.py:4952 ms3.8%
teardown0.20 ms0.4%
Estimated from 27 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
21 ms
apps/api/urls.py:73
touch_token(request.headers.get("Authorization"))
api_request.<locals>.decorator.<locals>.wrapped_view · Database
4 ms
apps/api/tasks.py:89
Session.objects.get_or_create(
process_ingest_start · Database
4 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:91
muted_tests = Test.objects.filter(project=project, mute__date_unmuted__isnull=True, mute__until__gte=timezone.now())
ingest_start · Database
2 ms
apps/api/urls.py:100
process_ingest_start(ingest.id)
ingest_start · Database
2 ms
apps/api/tasks.py:54
data = ingest.data
process_ingest_start · Database
2 ms
apps/projects/models.py:35
return (model.objects.filter(project_id=project_id).aggregate(last=models.Max("number"))["last"] or 0) + 1
next_number · Database
2 ms
apps/projects/models.py:188
super().save(*args, **kwargs)
Run.save · Database
2 ms

Fixtures

Exact setup time
monkeypatch function 0.06 ms
_dj_autoclear_mailbox function 0.05 ms
_django_db_marker function 0.04 ms
_template_string_if_invalid_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

Database

34 queries · 10 ms
No repeated queries.

Biggest pieces of work

call test body
apps/api/tests.py:396
48 ms
call _post_teardown
django/test/testcases.py:1240
2 ms
teardown pytest internals 0.20 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 51 ms e141198 main Profile
1 week, 5 days ago CI github-actions:test passed 34 ms 46ec2aa main Profile
2 weeks, 1 day ago CI github-actions:test passed 49 ms afde85b main Profile
2 weeks, 1 day ago CI github-actions:test passed 52 ms fe29f9d main Profile
2 weeks, 1 day ago CI github-actions:test passed 69 ms 044719a main Profile
2 weeks, 2 days ago CI github-actions:test passed 33 ms b3fedae main Profile
2 weeks, 4 days ago CI github-actions:test passed 54 ms 43c4eda main Profile
2 weeks, 6 days ago CI github-actions:test passed 54 ms 9caa567 main Profile
2 weeks, 6 days ago CI github-actions:test passed 54 ms ec75501 main Profile
3 weeks ago CI github-actions:test passed 81 ms d2c12e5 main Profile
3 weeks ago CI github-actions:test passed 29 ms 0b902f6 main Profile
3 weeks ago CI github-actions:test passed 57 ms 78a4357 main Profile