Tests / apps/api/tests.py
IngestEnvironmentTest::test_old_client_locally
First seen 8 hours ago in 78a4357
CI
github-actions:test
5 runs
Average
56 ms
median 54 ms
max 88 ms
max 88 ms
Phases
Setup 0.75 ms
Call 55 ms
Teardown 0.19 ms
Categories
Database 26 ms
Other (Libraries, Unsampled, pytest) 30 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, an hour ago ·
open run
setup0.70 ms1.3%
call54 ms98.4%
IngestEnvironmentTest.test_old_client_locallyapps/api/tests.py:411 session = self.ingest_start({"env": {}})50 ms92.6%
IngestEnvironmentTest.ingest_startapps/api/tests.py:352 response = self.client.post(47 ms86.8%
Client.postdjango/test/client.py:115347 ms86.8%
RequestFactory.postdjango/test/client.py:49947 ms86.8%
RequestFactory.genericdjango/test/client.py:67147 ms86.8%
Client.requestdjango/test/client.py:108247 ms86.8%
ClientHandler.__call__django/test/client.py:17328 ms52.1%
BaseHandler.load_middlewaredjango/core/handlers/base.py:6228 ms52.1%
WhiteNoiseMiddleware.__init__whitenoise/middleware.py:10428 ms52.1%
WhiteNoise.add_fileswhitenoise/base.py:10828 ms52.1%
WhiteNoise.update_files_dictionarywhitenoise/base.py:12016 ms28.9%
WhiteNoise.add_file_to_dictionarywhitenoise/base.py:13116 ms28.9%
WhiteNoise.get_static_filewhitenoise/base.py:20816 ms28.9%
StaticFile.__init__whitenoise/responders.py:739 ms17.4%
StaticFile.get_headerswhitenoise/responders.py:1763 ms5.8%
formatdate<stdlib>/email/utils.py:2663 ms5.8%
StaticFile.get_headerswhitenoise/responders.py:1783 ms5.8%
parsedate<stdlib>/email/_parseaddr.py:1853 ms5.8%
StaticFile.get_headerswhitenoise/responders.py:1683 ms5.8%
StaticFile.__init__whitenoise/responders.py:773 ms5.8%
StaticFile.get_alternativeswhitenoise/responders.py:2003 ms5.8%
__init____init__:-13 ms5.8%
StaticFile.__init__whitenoise/responders.py:743 ms5.8%
parsedate<stdlib>/email/_parseaddr.py:1853 ms5.8%
WhiteNoise.update_files_dictionarywhitenoise/base.py:1159 ms17.4%
scantreewhitenoise/base.py:2629 ms17.4%
scantreewhitenoise/base.py:2629 ms17.4%
scantreewhitenoise/base.py:2626 ms11.6%
scantreewhitenoise/base.py:2626 ms11.6%
scantreewhitenoise/base.py:2626 ms11.6%
scantreewhitenoise/base.py:2646 ms11.6%
<GC>~3 ms5.8%
scantreewhitenoise/base.py:2643 ms5.8%
ClientHandler.__call__django/test/client.py:18619 ms34.7%
BaseHandler.get_responsedjango/core/handlers/base.py:14119 ms34.7%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5519 ms34.7%
DebugToolbarMiddleware.__call__debug_toolbar/middleware.py:13019 ms34.7%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5519 ms34.7%
MiddlewareMixin.__call__django/utils/deprecation.py:30919 ms34.7%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5519 ms34.7%
WhiteNoiseMiddleware.__call__whitenoise/middleware.py:12319 ms34.7%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5519 ms34.7%
MiddlewareMixin.__call__django/utils/deprecation.py:30919 ms34.7%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5519 ms34.7%
MiddlewareMixin.__call__django/utils/deprecation.py:30919 ms34.7%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5519 ms34.7%
MiddlewareMixin.__call__django/utils/deprecation.py:30919 ms34.7%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5519 ms34.7%
MiddlewareMixin.__call__django/utils/deprecation.py:30919 ms34.7%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5519 ms34.7%
MiddlewareMixin.__call__django/utils/deprecation.py:30919 ms34.7%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5519 ms34.7%
MiddlewareMixin.__call__django/utils/deprecation.py:30919 ms34.7%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5519 ms34.7%
AccountMiddleware.<locals>.middlewareallauth/account/middleware.py:3419 ms34.7%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5519 ms34.7%
BaseHandler._get_responsedjango/core/handlers/base.py:19819 ms34.7%
csrf_exempt.<locals>._view_wrapperdjango/views/decorators/csrf.py:6519 ms34.7%
jsonify_errors.<locals>.wrapped_viewapps/api/urls.py:3719 ms34.7%
require_http_methods.<locals>.decorator.<locals>.innerdjango/views/decorators/http.py:6419 ms34.7%
api_request.<locals>.decorator.<locals>.wrapped_viewapps/api/urls.py:7519 ms34.7%
ingest_startapps/api/urls.py:100 process_ingest_start(ingest.id)16 ms28.9%
_SharedTaskProxy.__call__potatoq/app.py:76316 ms28.9%
Task.__call__potatoq/task.py:18916 ms28.9%
process_ingest_startapps/api/tasks.py:89 Session.objects.get_or_create(6 ms11.6%
BaseManager._get_queryset_methods.<locals>.create_method.<locals>.manager_methoddjango/db/models/manager.py:876 ms11.6%
QuerySet.get_or_createdjango/db/models/query.py:9923 ms5.8%
Atomic.__enter__django/db/transaction.py:2113 ms5.8%
async_unsafe.<locals>.decorator.<locals>.innerdjango/utils/asyncio.py:263 ms5.8%
BaseDatabaseWrapper.savepointdjango/db/backends/base/base.py:4003 ms5.8%
BaseDatabaseWrapper._savepointdjango/db/backends/base/base.py:3673 ms5.8%
CursorWrapper.executedjango/db/backends/utils.py:793 ms5.8%
QuerySet.get_or_createdjango/db/models/query.py:9943 ms5.8%
QuerySet.createdjango/db/models/query.py:6693 ms5.8%
Model.savedjango/db/models/base.py:8743 ms5.8%
Model.save_basedjango/db/models/base.py:9663 ms5.8%
Model._save_tabledjango/db/models/base.py:11673 ms5.8%
Model._do_insertdjango/db/models/base.py:12183 ms5.8%
BaseManager._get_queryset_methods.<locals>.create_method.<locals>.manager_methoddjango/db/models/manager.py:873 ms5.8%
QuerySet._insertdjango/db/models/query.py:19183 ms5.8%
SQLInsertCompiler.execute_sqldjango/db/models/sql/compiler.py:19253 ms5.8%
CursorWrapper.executedjango/db/backends/utils.py:793 ms5.8%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:923 ms5.8%
process_ingest_startapps/api/tasks.py:54 data = ingest.data3 ms5.8%
DeferredAttribute.__get__django/db/models/query_utils.py:2713 ms5.8%
Model.refresh_from_dbdjango/db/models/base.py:7583 ms5.8%
QuerySet.getdjango/db/models/query.py:6353 ms5.8%
QuerySet.__len__django/db/models/query.py:3723 ms5.8%
QuerySet._fetch_alldjango/db/models/query.py:20003 ms5.8%
ModelIterable.__iter__django/db/models/query.py:953 ms5.8%
SQLCompiler.execute_sqldjango/db/models/sql/compiler.py:16243 ms5.8%
CursorWrapper.executedjango/db/backends/utils.py:793 ms5.8%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:923 ms5.8%
CursorWrapper._executedjango/db/backends/utils.py:1053 ms5.8%
Cursor.executepsycopg/cursor.py:1133 ms5.8%
Connection.waitpsycopg/connection.py:4953 ms5.8%
BaseCursor._execute_genpsycopg/_cursor_base.py:2063 ms5.8%
BaseCursor._maybe_prepare_genpsycopg/_cursor_base.py:2863 ms5.8%
ClientCursorMixin._execute_sendpsycopg/client_cursor.py:783 ms5.8%
process_ingest_startapps/api/tasks.py:843 ms5.8%
get_or_create_environmentapps/projects/environments.py:63 obj, created = Environment.objects.get_or_create(3 ms5.8%
BaseManager._get_queryset_methods.<locals>.create_method.<locals>.manager_methoddjango/db/models/manager.py:873 ms5.8%
QuerySet.get_or_createdjango/db/models/query.py:9943 ms5.8%
QuerySet.createdjango/db/models/query.py:6693 ms5.8%
Model.savedjango/db/models/base.py:8743 ms5.8%
Model.save_basedjango/db/models/base.py:9663 ms5.8%
Model._save_tabledjango/db/models/base.py:11673 ms5.8%
Model._do_insertdjango/db/models/base.py:12183 ms5.8%
BaseManager._get_queryset_methods.<locals>.create_method.<locals>.manager_methoddjango/db/models/manager.py:873 ms5.8%
QuerySet._insertdjango/db/models/query.py:19183 ms5.8%
SQLInsertCompiler.execute_sqldjango/db/models/sql/compiler.py:19253 ms5.8%
CursorWrapper.executedjango/db/backends/utils.py:793 ms5.8%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:923 ms5.8%
CursorWrapper._executedjango/db/backends/utils.py:1053 ms5.8%
Cursor.executepsycopg/cursor.py:1133 ms5.8%
Connection.waitpsycopg/connection.py:4953 ms5.8%
Atomic.__exit__django/db/transaction.py:2473 ms5.8%
async_unsafe.<locals>.decorator.<locals>.innerdjango/utils/asyncio.py:263 ms5.8%
BaseDatabaseWrapper.savepoint_commitdjango/db/backends/base/base.py:4313 ms5.8%
BaseDatabaseWrapper._savepoint_commitdjango/db/backends/base/base.py:3753 ms5.8%
CursorWrapper.executedjango/db/backends/utils.py:793 ms5.8%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:923 ms5.8%
CursorWrapper._executedjango/db/backends/utils.py:1033 ms5.8%
Cursor.executepsycopg/cursor.py:1133 ms5.8%
Connection.waitpsycopg/connection.py:4953 ms5.8%
BaseCursor._execute_genpsycopg/_cursor_base.py:2063 ms5.8%
BaseCursor._maybe_prepare_genpsycopg/_cursor_base.py:2863 ms5.8%
ClientCursorMixin._execute_sendpsycopg/client_cursor.py:783 ms5.8%
ingest_startapps/api/urls.py:90 ingest = Ingest.objects.create(project=project, source="ingest_start", data=json.loads(request.body))3 ms5.8%
BaseManager._get_queryset_methods.<locals>.create_method.<locals>.manager_methoddjango/db/models/manager.py:873 ms5.8%
QuerySet.createdjango/db/models/query.py:6673 ms5.8%
IngestEnvironmentTest.ingest_startapps/api/tests.py:359 return Session.objects.get(ingest_id=response.json()["ingest_id"])3 ms5.8%
BaseManager._get_queryset_methods.<locals>.create_method.<locals>.manager_methoddjango/db/models/manager.py:873 ms5.8%
QuerySet.getdjango/db/models/query.py:6353 ms5.8%
QuerySet.__len__django/db/models/query.py:3723 ms5.8%
QuerySet._fetch_alldjango/db/models/query.py:20003 ms5.8%
ModelIterable.__iter__django/db/models/query.py:953 ms5.8%
SQLCompiler.execute_sqldjango/db/models/sql/compiler.py:16243 ms5.8%
CursorWrapper.executedjango/db/backends/utils.py:793 ms5.8%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:923 ms5.8%
CursorWrapper._executedjango/db/backends/utils.py:1053 ms5.8%
Cursor.executepsycopg/cursor.py:1133 ms5.8%
Connection.waitpsycopg/connection.py:4953 ms5.8%
TransactionTestCase._post_teardowndjango/test/testcases.py:1240 self._fixture_teardown()3 ms5.8%
TestCase._fixture_teardowndjango/test/testcases.py:14953 ms5.8%
DatabaseWrapper.check_constraintsdjango/db/backends/postgresql/base.py:4843 ms5.8%
CursorWrapper.executedjango/db/backends/utils.py:793 ms5.8%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:923 ms5.8%
CursorWrapper._executedjango/db/backends/utils.py:1033 ms5.8%
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
|
28 ms |
|
apps/api/tasks.py:89
Session.objects.get_or_create(
process_ingest_start
· Database
|
6 ms |
|
apps/api/urls.py:90
ingest = Ingest.objects.create(project=project, source="ingest_start", data=json.loads(request.body))
ingest_start
· Database
|
3 ms |
|
apps/api/tasks.py:54
data = ingest.data
process_ingest_start
· Database
|
3 ms |
|
apps/projects/environments.py:63
obj, created = Environment.objects.get_or_create(
get_or_create_environment
· Database
|
3 ms |
|
apps/api/urls.py:100
process_ingest_start(ingest.id)
ingest_start
· Database
|
3 ms |
|
apps/api/tests.py:359
return Session.objects.get(ingest_id=response.json()["ingest_id"])
IngestEnvironmentTest.ingest_start
· Database
|
3 ms |
Fixtures
Exact setup time| _django_set_urlconf function | 0.06 ms |
| _dj_autoclear_mailbox function | 0.04 ms |
| _template_string_if_invalid_marker function | 0.04 ms |
| _django_db_marker function | 0.03 ms |
| _live_server_helper function | 0.03 ms |
| _django_clear_site_cache function | 0.03 ms |
| monkeypatch function | 0.02 ms |
Database
34 queries · 10 msNo repeated queries.
Biggest pieces of work
|
call test body
apps/api/tests.py:411
|
50 ms |
|
call _post_teardown
django/test/testcases.py:1240
|
3 ms |
| setup pytest internals | 0.70 ms |
Reliability
5 results · 0 CI failures · 0 local failuresThis test hasn't failed recently.
History
Latest 5 results, oldest first in the strip| When | Environment | Outcome | Duration | |
|---|---|---|---|---|
| an hour ago | CI github-actions:test | passed | 54 ms | Profile |
| an hour ago | CI github-actions:test | passed | 54 ms | Profile |
| 8 hours ago | CI github-actions:test | passed | 88 ms | Profile |
| 8 hours ago | CI github-actions:test | passed | 29 ms | Profile |
| 8 hours ago | CI github-actions:test | passed | 53 ms | Profile |