Tests / apps/api/tests.py
IngestEnvironmentTest::test_old_client_locally
First seen 1 month, 1 week ago in 78a4357
CI
github-actions:test
15 runs
Average
50 ms
median 53 ms
max 88 ms
max 88 ms
Phases
Setup 0.67 ms
Call 50 ms
Teardown 0.17 ms
Categories
Database 26 ms
Other (Libraries, Unsampled, pytest) 24 ms
34 database queries per run
Needs 1 KB of memory (max 8 KB)
Duration per run
Where the time goes
Latest run in ci:github-actions:test, 2 weeks ago ·
open run
setup0.70 ms1.7%
call40 ms98.0%
IngestEnvironmentTest.test_old_client_locallyapps/api/tests.py:411 session = self.ingest_start({"env": {}})33 ms81.6%
IngestEnvironmentTest.ingest_startapps/api/tests.py:352 response = self.client.post(33 ms81.6%
Client.postdjango/test/client.py:115333 ms81.6%
RequestFactory.postdjango/test/client.py:49933 ms81.6%
RequestFactory.genericdjango/test/client.py:67133 ms81.6%
Client.requestdjango/test/client.py:108233 ms81.6%
ClientHandler.__call__django/test/client.py:18618 ms43.5%
BaseHandler.get_responsedjango/core/handlers/base.py:14118 ms43.5%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5518 ms43.5%
DebugToolbarMiddleware.__call__debug_toolbar/middleware.py:13018 ms43.5%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5518 ms43.5%
MiddlewareMixin.__call__django/utils/deprecation.py:30918 ms43.5%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5518 ms43.5%
WhiteNoiseMiddleware.__call__whitenoise/middleware.py:12318 ms43.5%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5518 ms43.5%
MiddlewareMixin.__call__django/utils/deprecation.py:30918 ms43.5%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5518 ms43.5%
MiddlewareMixin.__call__django/utils/deprecation.py:30918 ms43.5%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5518 ms43.5%
MiddlewareMixin.__call__django/utils/deprecation.py:30918 ms43.5%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5518 ms43.5%
MiddlewareMixin.__call__django/utils/deprecation.py:30918 ms43.5%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5518 ms43.5%
MiddlewareMixin.__call__django/utils/deprecation.py:30918 ms43.5%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5518 ms43.5%
MiddlewareMixin.__call__django/utils/deprecation.py:30918 ms43.5%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5518 ms43.5%
AccountMiddleware.<locals>.middlewareallauth/account/middleware.py:3418 ms43.5%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5518 ms43.5%
BaseHandler._get_responsedjango/core/handlers/base.py:19818 ms43.5%
csrf_exempt.<locals>._view_wrapperdjango/views/decorators/csrf.py:6518 ms43.5%
jsonify_errors.<locals>.wrapped_viewapps/api/urls.py:3718 ms43.5%
require_http_methods.<locals>.decorator.<locals>.innerdjango/views/decorators/http.py:6418 ms43.5%
api_request.<locals>.decorator.<locals>.wrapped_viewapps/api/urls.py:75 return view_func(request, *args, **kwargs)18 ms43.5%
ingest_startapps/api/urls.py:100 process_ingest_start(ingest.id)11 ms27.2%
_SharedTaskProxy.__call__potatoq/app.py:76311 ms27.2%
Task.__call__potatoq/task.py:18911 ms27.2%
process_ingest_startapps/api/tasks.py:89 Session.objects.get_or_create(4 ms10.9%
BaseManager._get_queryset_methods.<locals>.create_method.<locals>.manager_methoddjango/db/models/manager.py:874 ms10.9%
QuerySet.get_or_createdjango/db/models/query.py:9872 ms5.4%
QuerySet.getdjango/db/models/query.py:6352 ms5.4%
QuerySet.__len__django/db/models/query.py:3722 ms5.4%
QuerySet._fetch_alldjango/db/models/query.py:20002 ms5.4%
ModelIterable.__iter__django/db/models/query.py:952 ms5.4%
SQLCompiler.execute_sqldjango/db/models/sql/compiler.py:16242 ms5.4%
CursorWrapper.executedjango/db/backends/utils.py:792 ms5.4%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:922 ms5.4%
CursorWrapper._executedjango/db/backends/utils.py:1052 ms5.4%
Cursor.executepsycopg/cursor.py:1132 ms5.4%
Connection.waitpsycopg/connection.py:4952 ms5.4%
QuerySet.get_or_createdjango/db/models/query.py:9942 ms5.4%
QuerySet.createdjango/db/models/query.py:6692 ms5.4%
Model.savedjango/db/models/base.py:8742 ms5.4%
Model.save_basedjango/db/models/base.py:9662 ms5.4%
Model._save_tabledjango/db/models/base.py:11672 ms5.4%
Model._do_insertdjango/db/models/base.py:12182 ms5.4%
BaseManager._get_queryset_methods.<locals>.create_method.<locals>.manager_methoddjango/db/models/manager.py:872 ms5.4%
QuerySet._insertdjango/db/models/query.py:19182 ms5.4%
SQLInsertCompiler.execute_sqldjango/db/models/sql/compiler.py:19252 ms5.4%
CursorWrapper.executedjango/db/backends/utils.py:792 ms5.4%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:922 ms5.4%
CursorWrapper._executedjango/db/backends/utils.py:1052 ms5.4%
Cursor.executepsycopg/cursor.py:1132 ms5.4%
Connection.waitpsycopg/connection.py:4952 ms5.4%
process_ingest_startapps/api/tasks.py:79 ingest.project,2 ms5.4%
ForwardManyToOneDescriptor.__get__django/db/models/fields/related_descriptors.py:2572 ms5.4%
ForwardManyToOneDescriptor.get_objectdjango/db/models/fields/related_descriptors.py:2222 ms5.4%
QuerySet.getdjango/db/models/query.py:6352 ms5.4%
QuerySet.__len__django/db/models/query.py:3722 ms5.4%
QuerySet._fetch_alldjango/db/models/query.py:20002 ms5.4%
ModelIterable.__iter__django/db/models/query.py:952 ms5.4%
SQLCompiler.execute_sqldjango/db/models/sql/compiler.py:16242 ms5.4%
CursorWrapper.executedjango/db/backends/utils.py:792 ms5.4%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:922 ms5.4%
CursorWrapper._executedjango/db/backends/utils.py:1052 ms5.4%
Cursor.executepsycopg/cursor.py:1132 ms5.4%
Connection.waitpsycopg/connection.py:4952 ms5.4%
process_ingest_startapps/api/tasks.py:772 ms5.4%
get_or_create_numberedapps/projects/models.py:212 ms5.4%
next_numberapps/projects/models.py:35 return (model.objects.filter(project_id=project_id).aggregate(last=models.Max("number"))["last"] or 0) + 12 ms5.4%
QuerySet.aggregatedjango/db/models/query.py:5942 ms5.4%
Query.get_aggregationdjango/db/models/sql/query.py:6332 ms5.4%
SQLCompiler.execute_sqldjango/db/models/sql/compiler.py:16242 ms5.4%
CursorWrapper.executedjango/db/backends/utils.py:792 ms5.4%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:922 ms5.4%
CursorWrapper._executedjango/db/backends/utils.py:1052 ms5.4%
Cursor.executepsycopg/cursor.py:1132 ms5.4%
Connection.waitpsycopg/connection.py:4952 ms5.4%
process_ingest_startapps/api/tasks.py:842 ms5.4%
get_or_create_environmentapps/projects/environments.py:63 obj, created = Environment.objects.get_or_create(2 ms5.4%
BaseManager._get_queryset_methods.<locals>.create_method.<locals>.manager_methoddjango/db/models/manager.py:872 ms5.4%
QuerySet.get_or_createdjango/db/models/query.py:9942 ms5.4%
QuerySet.createdjango/db/models/query.py:6692 ms5.4%
Model.savedjango/db/models/base.py:8742 ms5.4%
Model.save_basedjango/db/models/base.py:9662 ms5.4%
Model._save_tabledjango/db/models/base.py:11672 ms5.4%
Model._do_insertdjango/db/models/base.py:12182 ms5.4%
BaseManager._get_queryset_methods.<locals>.create_method.<locals>.manager_methoddjango/db/models/manager.py:872 ms5.4%
QuerySet._insertdjango/db/models/query.py:19182 ms5.4%
SQLInsertCompiler.execute_sqldjango/db/models/sql/compiler.py:19252 ms5.4%
CursorWrapper.executedjango/db/backends/utils.py:792 ms5.4%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:922 ms5.4%
CursorWrapper._executedjango/db/backends/utils.py:1052 ms5.4%
Cursor.executepsycopg/cursor.py:1132 ms5.4%
Connection.waitpsycopg/connection.py:4952 ms5.4%
ingest_startapps/api/urls.py:91 muted_tests = Test.objects.filter(project=project, mute__date_unmuted__isnull=True, mute__until__gte=timezone.now())4 ms10.9%
BaseManager._get_queryset_methods.<locals>.create_method.<locals>.manager_methoddjango/db/models/manager.py:874 ms10.9%
QuerySet.filterdjango/db/models/query.py:15424 ms10.9%
QuerySet._filter_or_excludedjango/db/models/query.py:15604 ms10.9%
QuerySet._filter_or_exclude_inplacedjango/db/models/query.py:15704 ms10.9%
Query.add_qdjango/db/models/sql/query.py:16714 ms10.9%
Query._add_qdjango/db/models/sql/query.py:17032 ms5.4%
Query.build_filterdjango/db/models/sql/query.py:15512 ms5.4%
Query.solve_lookup_typedjango/db/models/sql/query.py:13582 ms5.4%
Query.names_to_pathdjango/db/models/sql/query.py:18462 ms5.4%
Query._add_qdjango/db/models/sql/query.py:17142 ms5.4%
ingest_startapps/api/urls.py:95 "muted_tests": [{"name": test.name} for test in muted_tests],2 ms5.4%
QuerySet.__iter__django/db/models/query.py:3902 ms5.4%
QuerySet._fetch_alldjango/db/models/query.py:20002 ms5.4%
ModelIterable.__iter__django/db/models/query.py:952 ms5.4%
SQLCompiler.execute_sqldjango/db/models/sql/compiler.py:16112 ms5.4%
SQLCompiler.as_sqldjango/db/models/sql/compiler.py:7672 ms5.4%
SQLCompiler.pre_sql_setupdjango/db/models/sql/compiler.py:862 ms5.4%
SQLCompiler.setup_querydjango/db/models/sql/compiler.py:752 ms5.4%
SQLCompiler.get_selectdjango/db/models/sql/compiler.py:2552 ms5.4%
SQLCompiler.get_default_columnsdjango/db/models/sql/compiler.py:10302 ms5.4%
ForeignKey.get_coldjango/db/models/fields/related.py:12542 ms5.4%
Field.get_coldjango/db/models/fields/__init__.py:5462 ms5.4%
Col.__init__django/db/models/expressions.py:13142 ms5.4%
ClientHandler.__call__django/test/client.py:17315 ms38.1%
BaseHandler.load_middlewaredjango/core/handlers/base.py:6215 ms38.1%
WhiteNoiseMiddleware.__init__whitenoise/middleware.py:10415 ms38.1%
WhiteNoise.add_fileswhitenoise/base.py:10815 ms38.1%
WhiteNoise.update_files_dictionarywhitenoise/base.py:12011 ms27.2%
WhiteNoise.add_file_to_dictionarywhitenoise/base.py:13111 ms27.2%
WhiteNoise.get_static_filewhitenoise/base.py:2034 ms10.9%
WhiteNoise.add_cache_headerswhitenoise/base.py:2242 ms5.4%
WhiteNoiseMiddleware.immutable_file_testwhitenoise/middleware.py:1762 ms5.4%
WhiteNoiseMiddleware.get_static_urlwhitenoise/middleware.py:1972 ms5.4%
URLMixin.urldebug_toolbar/panels/staticfiles.py:202 ms5.4%
HashedFilesMixin.urldjango/contrib/staticfiles/storage.py:2052 ms5.4%
HashedFilesMixin._urldjango/contrib/staticfiles/storage.py:1782 ms5.4%
WhiteNoise.add_cache_headerswhitenoise/base.py:2272 ms5.4%
WhiteNoise.get_static_filewhitenoise/base.py:2022 ms5.4%
WhiteNoise.get_static_filewhitenoise/base.py:2082 ms5.4%
StaticFile.__init__whitenoise/responders.py:732 ms5.4%
StaticFile.get_headerswhitenoise/responders.py:1762 ms5.4%
formatdate<stdlib>/email/utils.py:2662 ms5.4%
format_datetime<stdlib>/email/utils.py:2842 ms5.4%
WhiteNoise.update_files_dictionarywhitenoise/base.py:1154 ms10.9%
scantreewhitenoise/base.py:2624 ms10.9%
scantreewhitenoise/base.py:2624 ms10.9%
scantreewhitenoise/base.py:2622 ms5.4%
scantreewhitenoise/base.py:2622 ms5.4%
scantreewhitenoise/base.py:2602 ms5.4%
scantreewhitenoise/base.py:2602 ms5.4%
TransactionTestCase._pre_setupdjango/test/testcases.py:1164 cls._fixture_setup()2 ms5.4%
TestCase._fixture_setupdjango/test/testcases.py:14782 ms5.4%
TestCase._enter_atomicsdjango/test/testcases.py:13962 ms5.4%
Atomic.__enter__django/db/transaction.py:2112 ms5.4%
async_unsafe.<locals>.decorator.<locals>.innerdjango/utils/asyncio.py:262 ms5.4%
BaseDatabaseWrapper.savepointdjango/db/backends/base/base.py:4002 ms5.4%
BaseDatabaseWrapper._savepointdjango/db/backends/base/base.py:3672 ms5.4%
CursorWrapper.executedjango/db/backends/utils.py:792 ms5.4%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:922 ms5.4%
CursorWrapper._executedjango/db/backends/utils.py:1032 ms5.4%
Cursor.executepsycopg/cursor.py:1132 ms5.4%
Connection.waitpsycopg/connection.py:4952 ms5.4%
IngestEnvironmentTest.test_old_client_locallyapps/api/tests.py:412 self.assertEqual(session.environment.name, "local:unknown")2 ms5.4%
ForwardManyToOneDescriptor.__get__django/db/models/fields/related_descriptors.py:2572 ms5.4%
ForwardManyToOneDescriptor.get_objectdjango/db/models/fields/related_descriptors.py:2222 ms5.4%
QuerySet.getdjango/db/models/query.py:6352 ms5.4%
QuerySet.__len__django/db/models/query.py:3722 ms5.4%
QuerySet._fetch_alldjango/db/models/query.py:20002 ms5.4%
ModelIterable.__iter__django/db/models/query.py:952 ms5.4%
SQLCompiler.execute_sqldjango/db/models/sql/compiler.py:16112 ms5.4%
SQLCompiler.as_sqldjango/db/models/sql/compiler.py:7672 ms5.4%
SQLCompiler.pre_sql_setupdjango/db/models/sql/compiler.py:882 ms5.4%
WhereNode.split_having_qualifydjango/db/models/sql/where.py:472 ms5.4%
TransactionTestCase._post_teardowndjango/test/testcases.py:1240 self._fixture_teardown()2 ms5.4%
TestCase._fixture_teardowndjango/test/testcases.py:14952 ms5.4%
DatabaseWrapper.check_constraintsdjango/db/backends/postgresql/base.py:4842 ms5.4%
CursorWrapper.executedjango/db/backends/utils.py:792 ms5.4%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:922 ms5.4%
CursorWrapper._executedjango/db/backends/utils.py:1032 ms5.4%
Cursor.executepsycopg/cursor.py:1132 ms5.4%
Connection.waitpsycopg/connection.py:4952 ms5.4%
Estimated from 19 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
|
15 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
|
4 ms |
|
apps/api/tasks.py:89
Session.objects.get_or_create(
process_ingest_start
· Database
|
4 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:79
ingest.project,
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/environments.py:63
obj, created = Environment.objects.get_or_create(
get_or_create_environment
· Database
|
2 ms |
|
apps/api/tests.py:412
self.assertEqual(session.environment.name, "local:unknown")
IngestEnvironmentTest.test_old_client_locally
· Database
|
2 ms |
Fixtures
Exact setup time| _dj_autoclear_mailbox function | 0.06 ms |
| _template_string_if_invalid_marker function | 0.04 ms |
| _django_db_marker function | 0.03 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.03 ms |
Database
34 queries · 8 msNo repeated queries.
Biggest pieces of work
|
call test body
apps/api/tests.py:411
|
35 ms |
|
call _pre_setup
django/test/testcases.py:1164
|
2 ms |
|
call _post_teardown
django/test/testcases.py:1240
|
2 ms |
| setup pytest internals | 0.70 ms |
Reliability
15 results · 0 CI failures · 0 local failuresThis test hasn't failed recently.
History
Latest 15 results, oldest first in the strip| When | Environment | Outcome | Duration | |
|---|---|---|---|---|
| 2 weeks ago | CI github-actions:test | passed | 40 ms | Profile |
| 2 weeks, 4 days ago | CI github-actions:test | passed | 60 ms | Profile |
| 2 weeks, 6 days ago | CI github-actions:test | passed | 31 ms | Profile |
| 3 weeks ago | CI github-actions:test | passed | 59 ms | Profile |
| 1 month ago | CI github-actions:test | passed | 30 ms | Profile |
| 1 month ago | CI github-actions:test | passed | 53 ms | Profile |
| 1 month ago | CI github-actions:test | passed | 49 ms | Profile |
| 1 month ago | CI github-actions:test | passed | 65 ms | Profile |
| 1 month ago | CI github-actions:test | passed | 31 ms | Profile |
| 1 month, 1 week ago | CI github-actions:test | passed | 56 ms | Profile |
| 1 month, 1 week ago | CI github-actions:test | passed | 54 ms | Profile |
| 1 month, 1 week ago | CI github-actions:test | passed | 54 ms | Profile |
| 1 month, 1 week ago | CI github-actions:test | passed | 88 ms | Profile |
| 1 month, 1 week ago | CI github-actions:test | passed | 29 ms | Profile |
| 1 month, 1 week ago | CI github-actions:test | passed | 53 ms | Profile |