Tests / apps/api/tests.py
TestInvalidIngest::test_ingest_invalid
First seen 2 years, 9 months ago in 9ff0a7e
CI
github-actions:test
5 runs
Average
132 ms
median 164 ms
max 212 ms
max 212 ms
Phases
Setup 13 ms
Call 119 ms
Teardown 0.18 ms
Categories
Database 27 ms
App code 0.88 ms
Other (Libraries, pytest, Unsampled) 105 ms
15 database queries per run
Needs 104 KB of memory (max 260 KB)
Duration per run
Where the time goes
Latest run in ci:github-actions:test, an hour ago ·
open run
setup14 ms7.2%
TestCase.setUpClassdjango/test/testcases.py:1423 cls.cls_atomics = cls._enter_atomics()14 ms7.2%
TestCase._enter_atomicsdjango/test/testcases.py:139614 ms7.2%
Atomic.__enter__django/db/transaction.py:19814 ms7.2%
BaseDatabaseWrapper.get_autocommitdjango/db/backends/base/base.py:45414 ms7.2%
SimpleTestCase.ensure_connection_patch_method.<locals>.patched_ensure_connectiondjango/test/testcases.py:30314 ms7.2%
async_unsafe.<locals>.decorator.<locals>.innerdjango/utils/asyncio.py:2614 ms7.2%
BaseDatabaseWrapper.ensure_connectiondjango/db/backends/base/base.py:27914 ms7.2%
async_unsafe.<locals>.decorator.<locals>.innerdjango/utils/asyncio.py:2614 ms7.2%
BaseDatabaseWrapper.connectdjango/db/backends/base/base.py:25612 ms6.6%
async_unsafe.<locals>.decorator.<locals>.innerdjango/utils/asyncio.py:2612 ms6.6%
DatabaseWrapper.get_new_connectiondjango/db/backends/postgresql/base.py:33312 ms6.6%
Connection.connectpsycopg/connection.py:1099 ms4.8%
wait_connpsycopg/waiting.py:1415 ms2.4%
EpollSelector.select<stdlib>/selectors.py:4525 ms2.4%
wait_connpsycopg/waiting.py:1455 ms2.4%
BaseConnection._connect_genpsycopg/_connection_base.py:4395 ms2.4%
Connection.connectpsycopg/connection.py:1003 ms1.8%
conninfo_attemptspsycopg/_conninfo_attempts.py:453 ms1.8%
_resolve_hostnamespsycopg/_conninfo_attempts.py:1023 ms1.8%
getaddrinfo<stdlib>/socket.py:9983 ms1.8%
BaseDatabaseWrapper.connectdjango/db/backends/base/base.py:2581 ms0.6%
DatabaseWrapper.init_connection_statedjango/db/backends/postgresql/base.py:4021 ms0.6%
DatabaseWrapper._configure_connectiondjango/db/backends/postgresql/base.py:3741 ms0.6%
DatabaseWrapper._configure_timezonedjango/db/backends/postgresql/base.py:3571 ms0.6%
Cursor.executepsycopg/cursor.py:1131 ms0.6%
Connection.waitpsycopg/connection.py:4951 ms0.6%
call175 ms92.7%
TestInvalidIngest.test_ingest_invalidapps/api/tests.py:58 response = self.client.post(166 ms88.2%
Client.postdjango/test/client.py:1153166 ms88.2%
RequestFactory.postdjango/test/client.py:499166 ms88.2%
RequestFactory.genericdjango/test/client.py:671166 ms88.2%
Client.requestdjango/test/client.py:1082166 ms88.2%
ClientHandler.__call__django/test/client.py:173162 ms86.3%
BaseHandler.load_middlewaredjango/core/handlers/base.py:62162 ms86.3%
WhiteNoiseMiddleware.__init__whitenoise/middleware.py:104162 ms86.3%
WhiteNoise.add_fileswhitenoise/base.py:108162 ms86.3%
WhiteNoise.update_files_dictionarywhitenoise/base.py:120156 ms83.0%
WhiteNoise.add_file_to_dictionarywhitenoise/base.py:131155 ms82.4%
WhiteNoise.get_static_filewhitenoise/base.py:208155 ms82.4%
StaticFile.__init__whitenoise/responders.py:72148 ms78.5%
StaticFile.get_file_statswhitenoise/responders.py:163148 ms78.5%
<GC>~148 ms78.5%
StaticFile.__init__whitenoise/responders.py:732 ms1.3%
StaticFile.get_headerswhitenoise/responders.py:1762 ms1.3%
StaticFile.__init__whitenoise/responders.py:772 ms1.3%
StaticFile.get_alternativeswhitenoise/responders.py:2001 ms0.6%
StaticFile.get_alternativeswhitenoise/responders.py:2011 ms0.6%
StaticFile.__init__whitenoise/responders.py:741 ms0.6%
parsedate<stdlib>/email/_parseaddr.py:1851 ms0.6%
StaticFile.__init__whitenoise/responders.py:761 ms0.6%
StaticFile.get_not_modified_responsewhitenoise/responders.py:1901 ms0.6%
WhiteNoise.update_files_dictionarywhitenoise/base.py:1156 ms3.2%
scantreewhitenoise/base.py:2626 ms3.2%
scantreewhitenoise/base.py:2626 ms3.2%
scantreewhitenoise/base.py:2626 ms3.2%
scantreewhitenoise/base.py:2626 ms3.2%
scantreewhitenoise/base.py:2625 ms2.6%
scantreewhitenoise/base.py:2645 ms2.6%
<GC>~5 ms2.6%
scantreewhitenoise/base.py:2641 ms0.6%
ClientHandler.__call__django/test/client.py:1864 ms1.9%
BaseHandler.get_responsedjango/core/handlers/base.py:1414 ms1.9%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:554 ms1.9%
DebugToolbarMiddleware.__call__debug_toolbar/middleware.py:1304 ms1.9%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:554 ms1.9%
MiddlewareMixin.__call__django/utils/deprecation.py:3094 ms1.9%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:554 ms1.9%
WhiteNoiseMiddleware.__call__whitenoise/middleware.py:1234 ms1.9%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:554 ms1.9%
MiddlewareMixin.__call__django/utils/deprecation.py:3094 ms1.9%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:554 ms1.9%
MiddlewareMixin.__call__django/utils/deprecation.py:3094 ms1.9%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:554 ms1.9%
MiddlewareMixin.__call__django/utils/deprecation.py:3094 ms1.9%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:554 ms1.9%
MiddlewareMixin.__call__django/utils/deprecation.py:3094 ms1.9%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:554 ms1.9%
MiddlewareMixin.__call__django/utils/deprecation.py:3094 ms1.9%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:554 ms1.9%
MiddlewareMixin.__call__django/utils/deprecation.py:3094 ms1.9%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:554 ms1.9%
AccountMiddleware.<locals>.middlewareallauth/account/middleware.py:344 ms1.9%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:554 ms1.9%
BaseHandler._get_responsedjango/core/handlers/base.py:1984 ms1.9%
csrf_exempt.<locals>._view_wrapperdjango/views/decorators/csrf.py:654 ms1.9%
jsonify_errors.<locals>.wrapped_viewapps/api/urls.py:374 ms1.9%
require_http_methods.<locals>.decorator.<locals>.innerdjango/views/decorators/http.py:644 ms1.9%
api_request.<locals>.decorator.<locals>.wrapped_viewapps/api/urls.py:73 touch_token(request.headers.get("Authorization"))2 ms1.3%
Atomic.__enter__django/db/transaction.py:2111 ms0.6%
async_unsafe.<locals>.decorator.<locals>.innerdjango/utils/asyncio.py:261 ms0.6%
BaseDatabaseWrapper.savepointdjango/db/backends/base/base.py:4001 ms0.6%
BaseDatabaseWrapper._savepointdjango/db/backends/base/base.py:3661 ms0.6%
async_unsafe.<locals>.decorator.<locals>.innerdjango/utils/asyncio.py:261 ms0.6%
touch_tokenapps/api/urls.py:59 SecretTokens.objects.filter(pk__in=list(stale)).update(date_last_used=now)1 ms0.6%
QuerySet.__iter__django/db/models/query.py:3901 ms0.6%
QuerySet._fetch_alldjango/db/models/query.py:20001 ms0.6%
FlatValuesListIterable.__iter__django/db/models/query.py:2771 ms0.6%
SQLCompiler.results_iterdjango/db/models/sql/compiler.py:15731 ms0.6%
SQLCompiler.execute_sqldjango/db/models/sql/compiler.py:16241 ms0.6%
CursorWrapper.executedjango/db/backends/utils.py:791 ms0.6%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:921 ms0.6%
CursorWrapper._executedjango/db/backends/utils.py:1051 ms0.6%
Cursor.executepsycopg/cursor.py:1131 ms0.6%
Connection.waitpsycopg/connection.py:4951 ms0.6%
api_request.<locals>.decorator.<locals>.wrapped_viewapps/api/urls.py:72 project = get_object_or_404(Project, secrettokens__token=request.headers.get("Authorization"))1 ms0.6%
get_object_or_404django/shortcuts.py:901 ms0.6%
QuerySet.getdjango/db/models/query.py:6351 ms0.6%
QuerySet.__len__django/db/models/query.py:3721 ms0.6%
QuerySet._fetch_alldjango/db/models/query.py:20001 ms0.6%
ModelIterable.__iter__django/db/models/query.py:951 ms0.6%
SQLCompiler.execute_sqldjango/db/models/sql/compiler.py:16241 ms0.6%
CursorWrapper.executedjango/db/backends/utils.py:791 ms0.6%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:921 ms0.6%
CursorWrapper._executedjango/db/backends/utils.py:1051 ms0.6%
Cursor.executepsycopg/cursor.py:1131 ms0.6%
Connection.waitpsycopg/connection.py:4951 ms0.6%
TestInvalidIngest.test_ingest_invalidapps/api/tests.py:556 ms3.2%
make_projectapps/projects/testing.py:622 ms1.3%
unique_slugapps/orgs/models.py:44 base = slugify(name)[:40].strip("-") or fallback1 ms0.6%
keep_lazy.<locals>.decorator.<locals>.wrapperdjango/utils/functional.py:2311 ms0.6%
slugifydjango/utils/text.py:4851 ms0.6%
sub<stdlib>/re/__init__.py:2101 ms0.6%
_compile<stdlib>/re/__init__.py:3521 ms0.6%
unique_slugapps/orgs/models.py:46 while slug in reserved or taken.filter(slug=slug).exists():1 ms0.6%
QuerySet.existsdjango/db/models/query.py:13371 ms0.6%
Query.has_resultsdjango/db/models/sql/query.py:6811 ms0.6%
SQLCompiler.has_resultsdjango/db/models/sql/compiler.py:15921 ms0.6%
SQLCompiler.execute_sqldjango/db/models/sql/compiler.py:16241 ms0.6%
CursorWrapper.executedjango/db/backends/utils.py:791 ms0.6%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:921 ms0.6%
CursorWrapper._executedjango/db/backends/utils.py:1051 ms0.6%
Cursor.executepsycopg/cursor.py:1131 ms0.6%
Connection.waitpsycopg/connection.py:4951 ms0.6%
make_projectapps/projects/testing.py:61 organization = Organization.objects.create(1 ms0.6%
BaseManager._get_queryset_methods.<locals>.create_method.<locals>.manager_methoddjango/db/models/manager.py:871 ms0.6%
QuerySet.createdjango/db/models/query.py:6691 ms0.6%
Model.savedjango/db/models/base.py:8741 ms0.6%
Model.save_basedjango/db/models/base.py:9661 ms0.6%
Model._save_tabledjango/db/models/base.py:11671 ms0.6%
Model._do_insertdjango/db/models/base.py:12181 ms0.6%
BaseManager._get_queryset_methods.<locals>.create_method.<locals>.manager_methoddjango/db/models/manager.py:871 ms0.6%
QuerySet._insertdjango/db/models/query.py:19181 ms0.6%
SQLInsertCompiler.execute_sqldjango/db/models/sql/compiler.py:19251 ms0.6%
CursorWrapper.executedjango/db/backends/utils.py:791 ms0.6%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:921 ms0.6%
CursorWrapper._executedjango/db/backends/utils.py:1051 ms0.6%
Cursor.executepsycopg/cursor.py:1131 ms0.6%
Connection.waitpsycopg/connection.py:4951 ms0.6%
make_projectapps/projects/testing.py:67 slug=unique_slug(name, organization.project_set.all(), fallback="project", reserved=RESERVED_PROJECT_SLUGS),1 ms0.6%
unique_slugapps/orgs/models.py:46 while slug in reserved or taken.filter(slug=slug).exists():1 ms0.6%
QuerySet.existsdjango/db/models/query.py:13371 ms0.6%
Query.has_resultsdjango/db/models/sql/query.py:6811 ms0.6%
SQLCompiler.has_resultsdjango/db/models/sql/compiler.py:15921 ms0.6%
SQLCompiler.execute_sqldjango/db/models/sql/compiler.py:16111 ms0.6%
SQLCompiler.as_sqldjango/db/models/sql/compiler.py:7671 ms0.6%
SQLCompiler.pre_sql_setupdjango/db/models/sql/compiler.py:861 ms0.6%
SQLCompiler.setup_querydjango/db/models/sql/compiler.py:751 ms0.6%
SQLCompiler.get_selectdjango/db/models/sql/compiler.py:2941 ms0.6%
make_projectapps/projects/testing.py:64 project = Project.objects.create(1 ms0.6%
BaseManager._get_queryset_methods.<locals>.create_method.<locals>.manager_methoddjango/db/models/manager.py:871 ms0.6%
QuerySet.createdjango/db/models/query.py:6691 ms0.6%
Model.savedjango/db/models/base.py:8741 ms0.6%
Model.save_basedjango/db/models/base.py:9661 ms0.6%
Model._save_tabledjango/db/models/base.py:11671 ms0.6%
Model._do_insertdjango/db/models/base.py:12181 ms0.6%
BaseManager._get_queryset_methods.<locals>.create_method.<locals>.manager_methoddjango/db/models/manager.py:871 ms0.6%
QuerySet._insertdjango/db/models/query.py:19181 ms0.6%
SQLInsertCompiler.execute_sqldjango/db/models/sql/compiler.py:19251 ms0.6%
CursorWrapper.executedjango/db/backends/utils.py:791 ms0.6%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:921 ms0.6%
CursorWrapper._executedjango/db/backends/utils.py:1051 ms0.6%
Cursor.executepsycopg/cursor.py:1131 ms0.6%
Connection.waitpsycopg/connection.py:4951 ms0.6%
TestInvalidIngest.test_ingest_invalidapps/api/tests.py:56 project.secrettokens_set.create(token=secret_token)1 ms0.6%
create_reverse_many_to_one_manager.<locals>.RelatedManager.createdjango/db/models/fields/related_descriptors.py:8331 ms0.6%
BaseManager._get_queryset_methods.<locals>.create_method.<locals>.manager_methoddjango/db/models/manager.py:871 ms0.6%
QuerySet.createdjango/db/models/query.py:6691 ms0.6%
Model.savedjango/db/models/base.py:8741 ms0.6%
Model.save_basedjango/db/models/base.py:9661 ms0.6%
Model._save_tabledjango/db/models/base.py:11671 ms0.6%
Model._do_insertdjango/db/models/base.py:12181 ms0.6%
BaseManager._get_queryset_methods.<locals>.create_method.<locals>.manager_methoddjango/db/models/manager.py:871 ms0.6%
QuerySet._insertdjango/db/models/query.py:19181 ms0.6%
SQLInsertCompiler.execute_sqldjango/db/models/sql/compiler.py:19251 ms0.6%
CursorWrapper.executedjango/db/backends/utils.py:791 ms0.6%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:921 ms0.6%
CursorWrapper._executedjango/db/backends/utils.py:1051 ms0.6%
Cursor.executepsycopg/cursor.py:1131 ms0.6%
Connection.waitpsycopg/connection.py:4951 ms0.6%
TransactionTestCase._post_teardowndjango/test/testcases.py:1240 self._fixture_teardown()1 ms0.6%
TestCase._fixture_teardowndjango/test/testcases.py:14951 ms0.6%
DatabaseWrapper.check_constraintsdjango/db/backends/postgresql/base.py:4841 ms0.6%
CursorWrapper.executedjango/db/backends/utils.py:791 ms0.6%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:921 ms0.6%
CursorWrapper._executedjango/db/backends/utils.py:1031 ms0.6%
Cursor.executepsycopg/cursor.py:1131 ms0.6%
Connection.waitpsycopg/connection.py:4951 ms0.6%
Estimated from 156 samples; phase durations are exact. Frames from pytest and pluggy are
hidden
.
Hot lines in your code
|
apps/api/tests.py:58
response = self.client.post(
TestInvalidIngest.test_ingest_invalid
· Libraries
|
162 ms |
|
apps/orgs/models.py:46
while slug in reserved or taken.filter(slug=slug).exists():
unique_slug
· Database
|
2 ms |
|
apps/orgs/models.py:44
base = slugify(name)[:40].strip("-") or fallback
unique_slug
· Libraries
|
1 ms |
|
apps/projects/testing.py:61
organization = Organization.objects.create(
make_project
· Database
|
1 ms |
|
apps/projects/testing.py:64
project = Project.objects.create(
make_project
· Database
|
1 ms |
|
apps/api/tests.py:56
project.secrettokens_set.create(token=secret_token)
TestInvalidIngest.test_ingest_invalid
· Database
|
1 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
|
1 ms |
|
apps/api/urls.py:73
touch_token(request.headers.get("Authorization"))
api_request.<locals>.decorator.<locals>.wrapped_view
· Database
|
1 ms |
|
apps/api/urls.py:59
SecretTokens.objects.filter(pk__in=list(stale)).update(date_last_used=now)
touch_token
· Database
|
1 ms |
Fixtures
Exact setup time| _unittest_setUpClass_fixture_TestInvalidIngest class | 12 ms |
| _django_setup_unittest class | 0.33 ms |
| _template_string_if_invalid_marker function | 0.07 ms |
| _django_db_marker function | 0.04 ms |
| _dj_autoclear_mailbox function | 0.04 ms |
| _live_server_helper function | 0.04 ms |
| _django_set_urlconf function | 0.04 ms |
| _django_clear_site_cache function | 0.03 ms |
| monkeypatch function | 0.02 ms |
Database
15 queries · 8 msNo repeated queries.
Biggest pieces of work
|
call test body
apps/api/tests.py:58
|
173 ms |
|
setup setUpClass
django/test/testcases.py:1423
|
14 ms |
|
call _post_teardown
django/test/testcases.py:1240
|
1 ms |
Reliability
5 results · 0 CI failures · 0 local failuresThis test hasn't failed recently.
History
Latest 50 results, oldest first in the strip| When | Environment | Outcome | Duration | |
|---|---|---|---|---|
| an hour ago | CI github-actions:test | passed | 188 ms | Profile |
| an hour ago | CI github-actions:test | passed | 212 ms | Profile |
| 8 hours ago | CI github-actions:test | passed | 164 ms | Profile |
| 8 hours ago | CI github-actions:test | passed | 35 ms | Profile |
| 8 hours ago | CI github-actions:test | passed | 63 ms | Profile |
| 2 years ago | CI github-actions | passed | 92 ms | Run |
| 2 years, 2 months ago | CI github-actions | passed | 114 ms | Run |
| 2 years, 3 months ago | CI github-actions | passed | 100 ms | Run |
| 2 years, 4 months ago | CI github-actions | passed | 188 ms | Run |
| 2 years, 4 months ago | CI github-actions | passed | 207 ms | Run |
| 2 years, 4 months ago | CI github-actions | passed | 159 ms | Run |
| 2 years, 4 months ago | CI github-actions | passed | 140 ms | Run |
| 2 years, 5 months ago | CI github-actions | passed | 90 ms | Run |
| 2 years, 5 months ago | CI github-actions | passed | 87 ms | Run |
| 2 years, 5 months ago | CI github-actions | passed | 91 ms | Run |
| 2 years, 5 months ago | CI github-actions | passed | 90 ms | Run |
| 2 years, 5 months ago | CI github-actions | passed | 91 ms | Run |
| 2 years, 6 months ago | CI github-actions | passed | 90 ms | Run |
| 2 years, 6 months ago | CI github-actions | passed | 89 ms | Run |
| 2 years, 6 months ago | CI github-actions | passed | 88 ms | Run |