Tests / apps/api/tests.py
ProfileUploadTest::test_processing_failure_is_recorded
First seen 8 hours ago in 78a4357
CI
github-actions:test
5 runs
Average
12 ms
median 13 ms
max 15 ms
max 15 ms
Phases
Setup 0.70 ms
Call 11 ms
Teardown 0.17 ms
Categories
Database 10 ms
Other (Unsampled, pytest, Libraries) 3 ms
15 database queries per run
Needs 2 KB of memory (max 4 KB)
Duration per run
Where the time goes
Latest run in ci:github-actions:test, an hour ago ·
open run
setup0.90 ms7.0%
CallInfo.from_call_pytest/runner.py:3530.90 ms7.0%
call_and_report.<locals>.<lambda>_pytest/runner.py:2450.90 ms7.0%
HookCaller.__call__pluggy/_hooks.py:5120.90 ms7.0%
PluginManager._hookexecpluggy/_manager.py:1200.90 ms7.0%
_multicallpluggy/_callers.py:1210.90 ms7.0%
pytest_runtest_setup_pytest/runner.py:1650.90 ms7.0%
SetupState.setup_pytest/runner.py:5230.90 ms7.0%
TestCaseFunction.setup_pytest/unittest.py:2270.90 ms7.0%
Function.setup_pytest/python.py:17230.90 ms7.0%
TopRequest._fillfixtures_pytest/fixtures.py:7070.90 ms7.0%
FixtureRequest.getfixturevalue_pytest/fixtures.py:5390.90 ms7.0%
FixtureRequest._get_active_fixturedef_pytest/fixtures.py:6270.90 ms7.0%
FixtureDef.execute_pytest/fixtures.py:10680.90 ms7.0%
FixtureRequest._get_active_fixturedef_pytest/fixtures.py:5580.90 ms7.0%
__init____init__:-10.90 ms7.0%
RequestFixtureDef.__init___pytest/fixtures.py:11330.90 ms7.0%
FixtureDef.__init___pytest/fixtures.py:10200.90 ms7.0%
getfuncargnames_pytest/compat.py:1360.90 ms7.0%
signature_pytest/compat.py:700.90 ms7.0%
signature<stdlib>/inspect.py:33400.90 ms7.0%
Signature.from_callable<stdlib>/inspect.py:30550.90 ms7.0%
_signature_from_callable<stdlib>/inspect.py:25250.90 ms7.0%
call12 ms91.9%
CallInfo.from_call_pytest/runner.py:35312 ms91.9%
call_and_report.<locals>.<lambda>_pytest/runner.py:24512 ms91.9%
HookCaller.__call__pluggy/_hooks.py:51212 ms91.9%
PluginManager._hookexecpluggy/_manager.py:12012 ms91.9%
_multicallpluggy/_callers.py:12112 ms91.9%
pytest_runtest_call_pytest/runner.py:17912 ms91.9%
_django_setup_unittest.<locals>.non_debugging_runtestpytest_django/plugin.py:57312 ms91.9%
SimpleTestCase.__call__django/test/testcases.py:31312 ms91.9%
SimpleTestCase._setup_and_calldjango/test/testcases.py:36810 ms76.6%
TestCase.__call__<stdlib>/unittest/case.py:74710 ms76.6%
TestCase.run<stdlib>/unittest/case.py:6918 ms61.2%
TestCase._callTestMethod<stdlib>/unittest/case.py:6378 ms61.2%
ProfileUploadTest.test_processing_failure_is_recordedapps/api/tests.py:905 profile = Profile.objects.create(project=self.project)4 ms30.6%
BaseManager._get_queryset_methods.<locals>.create_method.<locals>.manager_methoddjango/db/models/manager.py:874 ms30.6%
QuerySet.createdjango/db/models/query.py:6694 ms30.6%
Profile.saveapps/projects/models.py:465 self.number = next_number(type(self), self.project_id)2 ms15.3%
next_numberapps/projects/models.py:35 return (model.objects.filter(project_id=project_id).aggregate(last=models.Max("number"))["last"] or 0) + 12 ms15.3%
QuerySet.aggregatedjango/db/models/query.py:5942 ms15.3%
Query.get_aggregationdjango/db/models/sql/query.py:6332 ms15.3%
SQLCompiler.execute_sqldjango/db/models/sql/compiler.py:16242 ms15.3%
CursorWrapper.executedjango/db/backends/utils.py:792 ms15.3%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:922 ms15.3%
QueryTracker._django_wrapperflakytest/profiling/dbtrack.py:1002 ms15.3%
CursorWrapper._executedjango/db/backends/utils.py:1052 ms15.3%
Cursor.executepsycopg/cursor.py:1132 ms15.3%
Connection.waitpsycopg/connection.py:4952 ms15.3%
Profile.saveapps/projects/models.py:466 super().save(*args, **kwargs)2 ms15.3%
Model.savedjango/db/models/base.py:8742 ms15.3%
Model.save_basedjango/db/models/base.py:9662 ms15.3%
Model._save_tabledjango/db/models/base.py:11672 ms15.3%
Model._do_insertdjango/db/models/base.py:12182 ms15.3%
BaseManager._get_queryset_methods.<locals>.create_method.<locals>.manager_methoddjango/db/models/manager.py:872 ms15.3%
QuerySet._insertdjango/db/models/query.py:19182 ms15.3%
SQLInsertCompiler.execute_sqldjango/db/models/sql/compiler.py:19252 ms15.3%
CursorWrapper.executedjango/db/backends/utils.py:792 ms15.3%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:922 ms15.3%
QueryTracker._django_wrapperflakytest/profiling/dbtrack.py:1002 ms15.3%
CursorWrapper._executedjango/db/backends/utils.py:1052 ms15.3%
Cursor.executepsycopg/cursor.py:1132 ms15.3%
Connection.waitpsycopg/connection.py:4952 ms15.3%
ProfileUploadTest.test_processing_failure_is_recordedapps/api/tests.py:906 part = ProfilePart.objects.create(profile=profile, index=0, document=b"not gzip")2 ms15.3%
BaseManager._get_queryset_methods.<locals>.create_method.<locals>.manager_methoddjango/db/models/manager.py:872 ms15.3%
QuerySet.createdjango/db/models/query.py:6692 ms15.3%
Model.savedjango/db/models/base.py:8742 ms15.3%
Model.save_basedjango/db/models/base.py:9662 ms15.3%
Model._save_tabledjango/db/models/base.py:11672 ms15.3%
Model._do_insertdjango/db/models/base.py:12182 ms15.3%
BaseManager._get_queryset_methods.<locals>.create_method.<locals>.manager_methoddjango/db/models/manager.py:872 ms15.3%
QuerySet._insertdjango/db/models/query.py:19182 ms15.3%
SQLInsertCompiler.execute_sqldjango/db/models/sql/compiler.py:19252 ms15.3%
CursorWrapper.executedjango/db/backends/utils.py:792 ms15.3%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:922 ms15.3%
QueryTracker._django_wrapperflakytest/profiling/dbtrack.py:1002 ms15.3%
CursorWrapper._executedjango/db/backends/utils.py:1052 ms15.3%
Cursor.executepsycopg/cursor.py:1132 ms15.3%
Connection.waitpsycopg/connection.py:4952 ms15.3%
ProfileUploadTest.test_processing_failure_is_recordedapps/api/tests.py:9082 ms15.3%
_SharedTaskProxy.__call__potatoq/app.py:7632 ms15.3%
Task.__call__potatoq/task.py:1892 ms15.3%
process_profileapps/api/tasks.py:237 part = ProfilePart.objects.select_related("profile").get(id=part_id)2 ms15.3%
QuerySet.getdjango/db/models/query.py:6352 ms15.3%
QuerySet.__len__django/db/models/query.py:3722 ms15.3%
QuerySet._fetch_alldjango/db/models/query.py:20002 ms15.3%
ModelIterable.__iter__django/db/models/query.py:952 ms15.3%
SQLCompiler.execute_sqldjango/db/models/sql/compiler.py:16242 ms15.3%
CursorWrapper.executedjango/db/backends/utils.py:792 ms15.3%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:922 ms15.3%
QueryTracker._django_wrapperflakytest/profiling/dbtrack.py:1002 ms15.3%
CursorWrapper._executedjango/db/backends/utils.py:1052 ms15.3%
Cursor.executepsycopg/cursor.py:1132 ms15.3%
Connection.waitpsycopg/connection.py:4952 ms15.3%
TestCase.run<stdlib>/unittest/case.py:6812 ms15.3%
SimpleTestCase._setup_and_calldjango/test/testcases.py:3712 ms15.3%
TransactionTestCase._post_teardowndjango/test/testcases.py:1240 self._fixture_teardown()2 ms15.3%
TestCase._fixture_teardowndjango/test/testcases.py:14972 ms15.3%
TestCase._rollback_atomicsdjango/test/testcases.py:14052 ms15.3%
Atomic.__exit__django/db/transaction.py:2832 ms15.3%
async_unsafe.<locals>.decorator.<locals>.innerdjango/utils/asyncio.py:262 ms15.3%
BaseDatabaseWrapper.savepoint_rollbackdjango/db/backends/base/base.py:4132 ms15.3%
BaseDatabaseWrapper._savepoint_rollbackdjango/db/backends/base/base.py:3712 ms15.3%
CursorWrapper.executedjango/db/backends/utils.py:792 ms15.3%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:922 ms15.3%
QueryTracker._django_wrapperflakytest/profiling/dbtrack.py:1002 ms15.3%
CursorWrapper._executedjango/db/backends/utils.py:1032 ms15.3%
Cursor.executepsycopg/cursor.py:1132 ms15.3%
Connection.waitpsycopg/connection.py:4952 ms15.3%
Estimated from 7 samples; phase durations are exact. Frames from pytest and pluggy are
shown
.
Hot lines in your code
|
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:466
super().save(*args, **kwargs)
Profile.save
· Database
|
2 ms |
|
apps/api/tests.py:906
part = ProfilePart.objects.create(profile=profile, index=0, document=b"not gzip")
ProfileUploadTest.test_processing_failure_is_recorded
· Database
|
2 ms |
|
apps/api/tasks.py:237
part = ProfilePart.objects.select_related("profile").get(id=part_id)
process_profile
· Database
|
2 ms |
Fixtures
Exact setup time| _template_string_if_invalid_marker function | 0.06 ms |
| _django_db_marker function | 0.06 ms |
| _dj_autoclear_mailbox function | 0.05 ms |
| _django_set_urlconf function | 0.05 ms |
| _live_server_helper function | 0.05 ms |
| _django_clear_site_cache function | 0.03 ms |
| monkeypatch function | 0.03 ms |
Database
15 queries · 5 ms
Repeated queries are usually N+1 lookups: fetch them once with select_related / prefetch_related (or selectinload).
3×
SELECT "projects_profilepart"."id", "projects_profilepart"."profile_id", "projects_profilepart"."index", "projects_profilepart"."count", "projects_profilepart"."checksum", "projects_profilepart"."status", "projects_profilepart"."error", "projects_profilepart"."tests_count", "projects_profilepart"."…
Biggest pieces of work
|
call test body
apps/api/tests.py:905
|
8 ms |
| call pytest internals | 2 ms |
|
call _post_teardown
django/test/testcases.py:1240
|
2 ms |
|
setup __init__
__init__:-1
|
0.90 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 | 13 ms | Profile |
| an hour ago | CI github-actions:test | passed | 12 ms | Profile |
| 8 hours ago | CI github-actions:test | passed | 15 ms | Profile |
| 8 hours ago | CI github-actions:test | passed | 8 ms | Profile |
| 8 hours ago | CI github-actions:test | passed | 13 ms | Profile |