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

IngestEnvironmentTest::test_same_environment_is_reused

First seen 3 weeks ago in 78a4357
CI github-actions:test 12 runs
Average
68 ms
median 74 ms
max 104 ms
Phases
Setup 0.68 ms Call 65 ms Teardown 2 ms
Categories
Database 41 ms Test code 0.14 ms App code 0.09 ms Other (Libraries, Unsampled, pytest, Deep copies) 26 ms

61 database queries per run

Needs 4 KB of memory (max 12 KB)

Duration per run

Where the time goes

Latest run in ci:github-actions:test, 16 hours ago · open run
Show pytest frames
call75 ms94.8%
IngestEnvironmentTest.test_same_environment_is_reusedapps/api/tests.py:389 first = self.ingest_start({"environment": environment})58 ms73.1%
IngestEnvironmentTest.ingest_startapps/api/tests.py:352 response = self.client.post(56 ms70.4%
Client.postdjango/test/client.py:115356 ms70.4%
RequestFactory.postdjango/test/client.py:49956 ms70.4%
RequestFactory.genericdjango/test/client.py:67156 ms70.4%
Client.requestdjango/test/client.py:108256 ms70.4%
ClientHandler.__call__django/test/client.py:18639 ms48.8%
BaseHandler.get_responsedjango/core/handlers/base.py:14139 ms48.8%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5539 ms48.8%
DebugToolbarMiddleware.__call__debug_toolbar/middleware.py:13039 ms48.8%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5539 ms48.8%
MiddlewareMixin.__call__django/utils/deprecation.py:30939 ms48.8%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5539 ms48.8%
WhiteNoiseMiddleware.__call__whitenoise/middleware.py:12339 ms48.8%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5539 ms48.8%
MiddlewareMixin.__call__django/utils/deprecation.py:30939 ms48.8%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5539 ms48.8%
MiddlewareMixin.__call__django/utils/deprecation.py:30939 ms48.8%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5539 ms48.8%
MiddlewareMixin.__call__django/utils/deprecation.py:30939 ms48.8%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5539 ms48.8%
MiddlewareMixin.__call__django/utils/deprecation.py:30939 ms48.8%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5539 ms48.8%
MiddlewareMixin.__call__django/utils/deprecation.py:30939 ms48.8%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5539 ms48.8%
MiddlewareMixin.__call__django/utils/deprecation.py:30939 ms48.8%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5539 ms48.8%
AccountMiddleware.<locals>.middlewareallauth/account/middleware.py:3439 ms48.8%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5539 ms48.8%
BaseHandler._get_responsedjango/core/handlers/base.py:19839 ms48.8%
csrf_exempt.<locals>._view_wrapperdjango/views/decorators/csrf.py:6539 ms48.8%
jsonify_errors.<locals>.wrapped_viewapps/api/urls.py:3739 ms48.8%
require_http_methods.<locals>.decorator.<locals>.innerdjango/views/decorators/http.py:6439 ms48.8%
api_request.<locals>.decorator.<locals>.wrapped_viewapps/api/urls.py:7539 ms48.8%
ingest_startapps/api/urls.py:100 process_ingest_start(ingest.id)39 ms48.8%
_SharedTaskProxy.__call__potatoq/app.py:76339 ms48.8%
Task.__call__potatoq/task.py:18939 ms48.8%
process_ingest_startapps/api/tasks.py:7721 ms27.1%
get_or_create_numberedapps/projects/models.py:18 existing = model.objects.filter(project=project, **lookup).first()19 ms24.4%
QuerySet.firstdjango/db/models/query.py:114515 ms19.0%
QuerySet.__iter__django/db/models/query.py:39015 ms19.0%
QuerySet._fetch_alldjango/db/models/query.py:200015 ms19.0%
ModelIterable.__iter__django/db/models/query.py:9515 ms19.0%
SQLCompiler.execute_sqldjango/db/models/sql/compiler.py:162411 ms13.5%
CursorWrapper.executedjango/db/backends/utils.py:7911 ms13.5%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:9211 ms13.5%
CursorWrapper._executedjango/db/backends/utils.py:10511 ms13.5%
Cursor.executepsycopg/cursor.py:1139 ms10.8%
Connection.waitpsycopg/connection.py:4959 ms10.8%
BaseCursor._execute_genpsycopg/_cursor_base.py:2069 ms10.8%
BaseCursor._maybe_prepare_genpsycopg/_cursor_base.py:2869 ms10.8%
ClientCursorMixin._execute_sendpsycopg/client_cursor.py:789 ms10.8%
SQLCompiler.execute_sqldjango/db/models/sql/compiler.py:16114 ms5.4%
SQLCompiler.as_sqldjango/db/models/sql/compiler.py:7674 ms5.4%
SQLCompiler.pre_sql_setupdjango/db/models/sql/compiler.py:862 ms2.7%
SQLCompiler.setup_querydjango/db/models/sql/compiler.py:752 ms2.7%
SQLCompiler.get_selectdjango/db/models/sql/compiler.py:3172 ms2.7%
SQLCompiler.pre_sql_setupdjango/db/models/sql/compiler.py:872 ms2.7%
SQLCompiler.get_order_bydjango/db/models/sql/compiler.py:4912 ms2.7%
SQLCompiler._order_by_pairsdjango/db/models/sql/compiler.py:4162 ms2.7%
Expression.__hash__django/db/models/expressions.py:5622 ms2.7%
cached_property.__get__django/utils/functional.py:472 ms2.7%
Expression.identitydjango/db/models/expressions.py:5522 ms2.7%
Expression._identitydjango/db/models/expressions.py:5352 ms2.7%
BaseManager._get_queryset_methods.<locals>.create_method.<locals>.manager_methoddjango/db/models/manager.py:872 ms2.7%
QuerySet.filterdjango/db/models/query.py:15422 ms2.7%
QuerySet._filter_or_excludedjango/db/models/query.py:15602 ms2.7%
QuerySet._filter_or_exclude_inplacedjango/db/models/query.py:15702 ms2.7%
Query.add_qdjango/db/models/sql/query.py:16712 ms2.7%
Query._add_qdjango/db/models/sql/query.py:17032 ms2.7%
Query.build_filterdjango/db/models/sql/query.py:15512 ms2.7%
Query.solve_lookup_typedjango/db/models/sql/query.py:13582 ms2.7%
Query.names_to_pathdjango/db/models/sql/query.py:17762 ms2.7%
QuerySet.firstdjango/db/models/query.py:11402 ms2.7%
get_or_create_numberedapps/projects/models.py:24 return model.objects.create(project=project, number=number, **lookup, **(defaults or {})), True2 ms2.7%
BaseManager._get_queryset_methods.<locals>.create_method.<locals>.manager_methoddjango/db/models/manager.py:872 ms2.7%
BaseManager.get_querysetdjango/db/models/manager.py:1552 ms2.7%
process_ingest_startapps/api/tasks.py:79 ingest.project,13 ms16.3%
ForwardManyToOneDescriptor.__get__django/db/models/fields/related_descriptors.py:25713 ms16.3%
ForwardManyToOneDescriptor.get_objectdjango/db/models/fields/related_descriptors.py:22213 ms16.3%
QuerySet.getdjango/db/models/query.py:63513 ms16.3%
QuerySet.__len__django/db/models/query.py:37213 ms16.3%
QuerySet._fetch_alldjango/db/models/query.py:200013 ms16.3%
ModelIterable.__iter__django/db/models/query.py:9511 ms13.5%
SQLCompiler.execute_sqldjango/db/models/sql/compiler.py:16249 ms10.8%
CursorWrapper.executedjango/db/backends/utils.py:799 ms10.8%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:929 ms10.8%
CursorWrapper._executedjango/db/backends/utils.py:1059 ms10.8%
Cursor.executepsycopg/cursor.py:1139 ms10.8%
Connection.waitpsycopg/connection.py:4959 ms10.8%
BaseCursor._execute_genpsycopg/_cursor_base.py:2069 ms10.8%
BaseCursor._maybe_prepare_genpsycopg/_cursor_base.py:2869 ms10.8%
ClientCursorMixin._execute_sendpsycopg/client_cursor.py:789 ms10.8%
SQLCompiler.execute_sqldjango/db/models/sql/compiler.py:16112 ms2.7%
SQLCompiler.as_sqldjango/db/models/sql/compiler.py:7672 ms2.7%
SQLCompiler.pre_sql_setupdjango/db/models/sql/compiler.py:862 ms2.7%
SQLCompiler.setup_querydjango/db/models/sql/compiler.py:752 ms2.7%
SQLCompiler.get_selectdjango/db/models/sql/compiler.py:3172 ms2.7%
ModelIterable.__iter__django/db/models/query.py:1072 ms2.7%
process_ingest_startapps/api/tasks.py:89 Session.objects.get_or_create(4 ms5.4%
BaseManager._get_queryset_methods.<locals>.create_method.<locals>.manager_methoddjango/db/models/manager.py:874 ms5.4%
QuerySet.get_or_createdjango/db/models/query.py:9872 ms2.7%
QuerySet.getdjango/db/models/query.py:6352 ms2.7%
QuerySet.__len__django/db/models/query.py:3722 ms2.7%
QuerySet._fetch_alldjango/db/models/query.py:20002 ms2.7%
ModelIterable.__iter__django/db/models/query.py:952 ms2.7%
SQLCompiler.execute_sqldjango/db/models/sql/compiler.py:16112 ms2.7%
SQLCompiler.as_sqldjango/db/models/sql/compiler.py:7672 ms2.7%
SQLCompiler.pre_sql_setupdjango/db/models/sql/compiler.py:862 ms2.7%
SQLCompiler.setup_querydjango/db/models/sql/compiler.py:752 ms2.7%
SQLCompiler.get_selectdjango/db/models/sql/compiler.py:3172 ms2.7%
SQLCompiler.compiledjango/db/models/sql/compiler.py:5742 ms2.7%
QuerySet.get_or_createdjango/db/models/query.py:9942 ms2.7%
QuerySet.createdjango/db/models/query.py:6692 ms2.7%
Model.savedjango/db/models/base.py:8742 ms2.7%
Model.save_basedjango/db/models/base.py:9662 ms2.7%
Model._save_tabledjango/db/models/base.py:11672 ms2.7%
Model._do_insertdjango/db/models/base.py:12182 ms2.7%
BaseManager._get_queryset_methods.<locals>.create_method.<locals>.manager_methoddjango/db/models/manager.py:872 ms2.7%
QuerySet._insertdjango/db/models/query.py:19182 ms2.7%
SQLInsertCompiler.execute_sqldjango/db/models/sql/compiler.py:19242 ms2.7%
SQLInsertCompiler.as_sqldjango/db/models/sql/compiler.py:18132 ms2.7%
ClientHandler.__call__django/test/client.py:17317 ms21.7%
BaseHandler.load_middlewaredjango/core/handlers/base.py:6217 ms21.7%
WhiteNoiseMiddleware.__init__whitenoise/middleware.py:10417 ms21.7%
WhiteNoise.add_fileswhitenoise/base.py:10817 ms21.7%
WhiteNoise.update_files_dictionarywhitenoise/base.py:12015 ms19.0%
WhiteNoise.add_file_to_dictionarywhitenoise/base.py:13115 ms19.0%
WhiteNoise.get_static_filewhitenoise/base.py:20811 ms13.5%
StaticFile.__init__whitenoise/responders.py:734 ms5.4%
StaticFile.get_headerswhitenoise/responders.py:1782 ms2.7%
parsedate<stdlib>/email/_parseaddr.py:1852 ms2.7%
parsedate_tz<stdlib>/email/_parseaddr.py:502 ms2.7%
_parsedate_tz<stdlib>/email/_parseaddr.py:1612 ms2.7%
StaticFile.get_headerswhitenoise/responders.py:1762 ms2.7%
formatdate<stdlib>/email/utils.py:2662 ms2.7%
format_datetime<stdlib>/email/utils.py:2842 ms2.7%
StaticFile.__init__whitenoise/responders.py:774 ms5.4%
StaticFile.get_alternativeswhitenoise/responders.py:2042 ms2.7%
StaticFile.get_alternativeswhitenoise/responders.py:2002 ms2.7%
__init____init__:-12 ms2.7%
Headers.__init__<stdlib>/wsgiref/headers.py:432 ms2.7%
Headers._convert_string_type<stdlib>/wsgiref/headers.py:502 ms2.7%
StaticFile.__init__whitenoise/responders.py:762 ms2.7%
StaticFile.get_not_modified_responsewhitenoise/responders.py:1892 ms2.7%
Headers.__getitem__<stdlib>/wsgiref/headers.py:832 ms2.7%
Headers.get<stdlib>/wsgiref/headers.py:1042 ms2.7%
WhiteNoise.get_static_filewhitenoise/base.py:2032 ms2.7%
WhiteNoise.add_cache_headerswhitenoise/base.py:2242 ms2.7%
WhiteNoiseMiddleware.immutable_file_testwhitenoise/middleware.py:1762 ms2.7%
WhiteNoise.get_static_filewhitenoise/base.py:2022 ms2.7%
WhiteNoise.update_files_dictionarywhitenoise/base.py:1152 ms2.7%
scantreewhitenoise/base.py:2622 ms2.7%
scantreewhitenoise/base.py:2622 ms2.7%
scantreewhitenoise/base.py:2622 ms2.7%
scantreewhitenoise/base.py:2622 ms2.7%
scantreewhitenoise/base.py:2622 ms2.7%
scantreewhitenoise/base.py:2642 ms2.7%
IngestEnvironmentTest.ingest_startapps/api/tests.py:359 return Session.objects.get(ingest_id=response.json()["ingest_id"])2 ms2.7%
BaseManager._get_queryset_methods.<locals>.create_method.<locals>.manager_methoddjango/db/models/manager.py:872 ms2.7%
QuerySet.getdjango/db/models/query.py:6352 ms2.7%
QuerySet.__len__django/db/models/query.py:3722 ms2.7%
QuerySet._fetch_alldjango/db/models/query.py:20002 ms2.7%
ModelIterable.__iter__django/db/models/query.py:952 ms2.7%
SQLCompiler.execute_sqldjango/db/models/sql/compiler.py:16112 ms2.7%
SQLCompiler.as_sqldjango/db/models/sql/compiler.py:7672 ms2.7%
SQLCompiler.pre_sql_setupdjango/db/models/sql/compiler.py:862 ms2.7%
SQLCompiler.setup_querydjango/db/models/sql/compiler.py:752 ms2.7%
SQLCompiler.get_selectdjango/db/models/sql/compiler.py:3172 ms2.7%
SQLCompiler.compiledjango/db/models/sql/compiler.py:5782 ms2.7%
Col.as_sqldjango/db/models/expressions.py:13252 ms2.7%
SQLCompiler.quote_name_unless_aliasdjango/db/backends/postgresql/compiler.py:342 ms2.7%
SQLCompiler.quote_name_unless_aliasdjango/db/models/sql/compiler.py:5612 ms2.7%
IngestEnvironmentTest.test_same_environment_is_reusedapps/api/tests.py:39013 ms16.3%
IngestEnvironmentTest.ingest_startapps/api/tests.py:352 response = self.client.post(13 ms16.3%
Client.postdjango/test/client.py:115313 ms16.3%
RequestFactory.postdjango/test/client.py:49913 ms16.3%
RequestFactory.genericdjango/test/client.py:67113 ms16.3%
Client.requestdjango/test/client.py:108213 ms16.3%
ClientHandler.__call__django/test/client.py:18613 ms16.3%
BaseHandler.get_responsedjango/core/handlers/base.py:14113 ms16.3%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5513 ms16.3%
DebugToolbarMiddleware.__call__debug_toolbar/middleware.py:13013 ms16.3%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5513 ms16.3%
MiddlewareMixin.__call__django/utils/deprecation.py:30913 ms16.3%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5513 ms16.3%
WhiteNoiseMiddleware.__call__whitenoise/middleware.py:12313 ms16.3%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5513 ms16.3%
MiddlewareMixin.__call__django/utils/deprecation.py:30913 ms16.3%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5513 ms16.3%
MiddlewareMixin.__call__django/utils/deprecation.py:30913 ms16.3%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5513 ms16.3%
MiddlewareMixin.__call__django/utils/deprecation.py:30913 ms16.3%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5513 ms16.3%
MiddlewareMixin.__call__django/utils/deprecation.py:30913 ms16.3%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5513 ms16.3%
MiddlewareMixin.__call__django/utils/deprecation.py:30913 ms16.3%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5513 ms16.3%
MiddlewareMixin.__call__django/utils/deprecation.py:30913 ms16.3%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5513 ms16.3%
AccountMiddleware.<locals>.middlewareallauth/account/middleware.py:3413 ms16.3%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5513 ms16.3%
BaseHandler._get_responsedjango/core/handlers/base.py:19813 ms16.3%
csrf_exempt.<locals>._view_wrapperdjango/views/decorators/csrf.py:6513 ms16.3%
jsonify_errors.<locals>.wrapped_viewapps/api/urls.py:3713 ms16.3%
require_http_methods.<locals>.decorator.<locals>.innerdjango/views/decorators/http.py:6413 ms16.3%
api_request.<locals>.decorator.<locals>.wrapped_viewapps/api/urls.py:7511 ms13.5%
ingest_startapps/api/urls.py:100 process_ingest_start(ingest.id)11 ms13.5%
_SharedTaskProxy.__call__potatoq/app.py:76311 ms13.5%
Task.__call__potatoq/task.py:18911 ms13.5%
process_ingest_startapps/api/tasks.py:776 ms8.1%
get_or_create_numberedapps/projects/models.py:23 with transaction.atomic():4 ms5.4%
Atomic.__enter__django/db/transaction.py:1832 ms2.7%
Atomic.__exit__django/db/transaction.py:2472 ms2.7%
async_unsafe.<locals>.decorator.<locals>.innerdjango/utils/asyncio.py:262 ms2.7%
BaseDatabaseWrapper.savepoint_commitdjango/db/backends/base/base.py:4312 ms2.7%
BaseDatabaseWrapper._savepoint_commitdjango/db/backends/base/base.py:3752 ms2.7%
CursorWrapper.executedjango/db/backends/utils.py:792 ms2.7%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:922 ms2.7%
CursorWrapper._executedjango/db/backends/utils.py:1032 ms2.7%
Cursor.executepsycopg/cursor.py:1132 ms2.7%
Connection.waitpsycopg/connection.py:4952 ms2.7%
get_or_create_numberedapps/projects/models.py:18 existing = model.objects.filter(project=project, **lookup).first()2 ms2.7%
QuerySet.firstdjango/db/models/query.py:11452 ms2.7%
QuerySet.__iter__django/db/models/query.py:3902 ms2.7%
QuerySet._fetch_alldjango/db/models/query.py:20002 ms2.7%
ModelIterable.__iter__django/db/models/query.py:952 ms2.7%
SQLCompiler.execute_sqldjango/db/models/sql/compiler.py:16242 ms2.7%
CursorWrapper.executedjango/db/backends/utils.py:792 ms2.7%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:922 ms2.7%
CursorWrapper._executedjango/db/backends/utils.py:1052 ms2.7%
Cursor.executepsycopg/cursor.py:1132 ms2.7%
Connection.waitpsycopg/connection.py:4952 ms2.7%
process_ingest_startapps/api/tasks.py:79 ingest.project,4 ms5.4%
ForwardManyToOneDescriptor.__get__django/db/models/fields/related_descriptors.py:2442 ms2.7%
ForeignObject.get_local_related_valuedjango/db/models/fields/related.py:8122 ms2.7%
ForeignObject.get_instance_value_for_fieldsdjango/db/models/fields/related.py:8342 ms2.7%
DeferredAttribute.__get__django/db/models/query_utils.py:2712 ms2.7%
Model.refresh_from_dbdjango/db/models/base.py:7582 ms2.7%
QuerySet.getdjango/db/models/query.py:6352 ms2.7%
QuerySet.__len__django/db/models/query.py:3722 ms2.7%
QuerySet._fetch_alldjango/db/models/query.py:20002 ms2.7%
ModelIterable.__iter__django/db/models/query.py:952 ms2.7%
SQLCompiler.execute_sqldjango/db/models/sql/compiler.py:16242 ms2.7%
CursorWrapper.executedjango/db/backends/utils.py:792 ms2.7%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:922 ms2.7%
CursorWrapper._executedjango/db/backends/utils.py:1052 ms2.7%
Cursor.executepsycopg/cursor.py:1132 ms2.7%
Connection.waitpsycopg/connection.py:4952 ms2.7%
ForwardManyToOneDescriptor.__get__django/db/models/fields/related_descriptors.py:2572 ms2.7%
ForwardManyToOneDescriptor.get_objectdjango/db/models/fields/related_descriptors.py:2222 ms2.7%
QuerySet.getdjango/db/models/query.py:6352 ms2.7%
QuerySet.__len__django/db/models/query.py:3722 ms2.7%
QuerySet._fetch_alldjango/db/models/query.py:20002 ms2.7%
ModelIterable.__iter__django/db/models/query.py:952 ms2.7%
SQLCompiler.execute_sqldjango/db/models/sql/compiler.py:16242 ms2.7%
CursorWrapper.executedjango/db/backends/utils.py:792 ms2.7%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:922 ms2.7%
CursorWrapper._executedjango/db/backends/utils.py:1052 ms2.7%
Cursor.executepsycopg/cursor.py:1132 ms2.7%
Connection.waitpsycopg/connection.py:4952 ms2.7%
api_request.<locals>.decorator.<locals>.wrapped_viewapps/api/urls.py:73 touch_token(request.headers.get("Authorization"))2 ms2.7%
touch_tokenapps/api/urls.py:56 .filter(Q(date_last_used__lt=now - TOKEN_TOUCH_INTERVAL) | Q(date_last_used=None), token=token)2 ms2.7%
QuerySet.filterdjango/db/models/query.py:15422 ms2.7%
QuerySet._filter_or_excludedjango/db/models/query.py:15602 ms2.7%
QuerySet._filter_or_exclude_inplacedjango/db/models/query.py:15702 ms2.7%
Query.add_qdjango/db/models/sql/query.py:16712 ms2.7%
Query._add_qdjango/db/models/sql/query.py:17032 ms2.7%
Query.build_filterdjango/db/models/sql/query.py:15282 ms2.7%
Query._add_qdjango/db/models/sql/query.py:17032 ms2.7%
TransactionTestCase._pre_setupdjango/test/testcases.py:1164 cls._fixture_setup()4 ms5.4%
TestCase._fixture_setupdjango/test/testcases.py:14784 ms5.4%
TestCase._enter_atomicsdjango/test/testcases.py:13964 ms5.4%
Atomic.__enter__django/db/transaction.py:2114 ms5.4%
async_unsafe.<locals>.decorator.<locals>.innerdjango/utils/asyncio.py:264 ms5.4%
BaseDatabaseWrapper.savepointdjango/db/backends/base/base.py:4004 ms5.4%
BaseDatabaseWrapper._savepointdjango/db/backends/base/base.py:3664 ms5.4%
async_unsafe.<locals>.decorator.<locals>.innerdjango/utils/asyncio.py:264 ms5.4%
BaseDatabaseWrapper.cursordjango/db/backends/base/base.py:3204 ms5.4%
BaseDatabaseWrapper._cursordjango/db/backends/base/base.py:2984 ms5.4%
async_unsafe.<locals>.decorator.<locals>.innerdjango/utils/asyncio.py:264 ms5.4%
DatabaseWrapper.create_cursordjango/db/backends/postgresql/base.py:4304 ms5.4%
Connection.cursorpsycopg/connection.py:2594 ms5.4%
Cursor.__init__psycopg/cursor.py:474 ms5.4%
BaseCursor.__init__psycopg/_cursor_base.py:654 ms5.4%
__init____init__:-14 ms5.4%
AdaptersMap.__init__psycopg/_adapters_map.py:794 ms5.4%
Estimated from 35 samples; phase durations are exact. Frames from pytest and pluggy are hidden .

Hot lines in your code

apps/projects/models.py:18
existing = model.objects.filter(project=project, **lookup).first()
get_or_create_numbered · Database
21 ms
apps/api/tasks.py:79
ingest.project,
process_ingest_start · Database
17 ms
apps/api/tests.py:352
response = self.client.post(
IngestEnvironmentTest.ingest_start · Libraries
17 ms
apps/api/tasks.py:89
Session.objects.get_or_create(
process_ingest_start · Database
4 ms
apps/projects/models.py:23
with transaction.atomic():
get_or_create_numbered · Database
4 ms
apps/projects/models.py:24
return model.objects.create(project=project, number=number, **lookup, **(defaults or {})), True
get_or_create_numbered · Database
2 ms
apps/api/tests.py:359
return Session.objects.get(ingest_id=response.json()["ingest_id"])
IngestEnvironmentTest.ingest_start · Database
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

Fixtures

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

Database

61 queries · 17 ms

Repeated queries are usually N+1 lookups: fetch them once with select_related / prefetch_related (or selectinload).

4×
SELECT "projects_project"."id", "projects_project"."organization_id", "projects_project"."name", "projects_project"."slug", "projects_project"."public", "projects_project"."description", "projects_project"."date_created", "projects_project"."date_updated", "projects_project"."created_by_id" FROM "p…
4×
SELECT "projects_environment"."id", "projects_environment"."project_id", "projects_environment"."name", "projects_environment"."kind", "projects_environment"."provider", "projects_environment"."details", "projects_environment"."date_first_seen", "projects_environment"."date_last_seen" FROM "project…
4×
SELECT "projects_session"."id", "projects_session"."project_id", "projects_session"."run_id", "projects_session"."status", "projects_session"."exit_status", "projects_session"."date_created", "projects_session"."date_finished", "projects_session"."ingest_id", "projects_session"."environment_id", "p…

Biggest pieces of work

call test body
apps/api/tests.py:389
71 ms
call _pre_setup
django/test/testcases.py:1164
4 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 79 ms e141198 main Profile
1 week, 5 days ago CI github-actions:test passed 39 ms 46ec2aa main Profile
2 weeks, 1 day ago CI github-actions:test passed 66 ms afde85b main Profile
2 weeks, 1 day ago CI github-actions:test passed 58 ms fe29f9d main Profile
2 weeks, 1 day ago CI github-actions:test passed 78 ms 044719a main Profile
2 weeks, 2 days ago CI github-actions:test passed 39 ms b3fedae main Profile
2 weeks, 4 days ago CI github-actions:test passed 76 ms 43c4eda main Profile
2 weeks, 6 days ago CI github-actions:test passed 73 ms 9caa567 main Profile
2 weeks, 6 days ago CI github-actions:test passed 74 ms ec75501 main Profile
3 weeks ago CI github-actions:test passed 104 ms d2c12e5 main Profile
3 weeks ago CI github-actions:test passed 44 ms 0b902f6 main Profile
3 weeks ago CI github-actions:test passed 82 ms 78a4357 main Profile