Tests / confs/tests.py
TestResolveLegacyAccountsAndPosts::test_match_existing_post_by_post_id_and_account
First seen 1 month, 1 week ago in 0c23747
CI
github-actions:test
13 runs
Average
23 ms
median 19 ms
max 42 ms
max 42 ms
Phases
Setup 3 ms
Call 19 ms
Teardown 0.34 ms
Categories
Database 16 ms
Factories 2 ms
App code 0.08 ms
Test code 0.08 ms
Other (pytest, Unsampled, Libraries) 5 ms
10 database queries per run
Needs 1 KB of memory (max 4 KB)
Duration per run
Where the time goes
Latest run in ci:github-actions:test, 2 weeks ago ·
open run
setup0.69 ms4.9%
__init____init__:-10.69 ms4.9%
call13 ms93.9%
TestResolveLegacyAccountsAndPosts.test_match_existing_post_by_post_id_and_accountconfs/tests.py:3605 ms34.1%
_resolve_postsconfs/migrations/0033_remove_legacy_conference_tables.py:279 post_model.objects.bulk_create(to_create, ignore_conflicts=True, batch_size=IN_CHUNK_SIZE)2 ms17.1%
BaseManager._get_queryset_methods.<locals>.create_method.<locals>.manager_methoddjango/db/models/manager.py:872 ms17.1%
QuerySet.bulk_createdjango/db/models/query.py:9002 ms17.1%
QuerySet._batched_insertdjango/db/models/query.py:21792 ms17.1%
QuerySet._insertdjango/db/models/query.py:21412 ms17.1%
SQLInsertCompiler.execute_sqldjango/db/models/sql/compiler.py:19341 ms8.5%
async_unsafe.<locals>.decorator.<locals>.innerdjango/utils/asyncio.py:261 ms8.5%
BaseDatabaseWrapper.cursordjango/db/backends/base/base.py:3201 ms8.5%
BaseDatabaseWrapper._cursordjango/db/backends/base/base.py:2981 ms8.5%
async_unsafe.<locals>.decorator.<locals>.innerdjango/utils/asyncio.py:261 ms8.5%
SQLInsertCompiler.execute_sqldjango/db/models/sql/compiler.py:19361 ms8.5%
CursorWrapper.executedjango/db/backends/utils.py:791 ms8.5%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:921 ms8.5%
CursorWrapper._executedjango/db/backends/utils.py:1051 ms8.5%
Cursor.executepsycopg/cursor.py:1131 ms8.5%
Connection.waitpsycopg/connection.py:4951 ms8.5%
BaseCursor._execute_genpsycopg/_cursor_base.py:2061 ms8.5%
BaseCursor._maybe_prepare_genpsycopg/_cursor_base.py:2861 ms8.5%
ClientCursorMixin._execute_sendpsycopg/client_cursor.py:781 ms8.5%
_resolve_postsconfs/migrations/0033_remove_legacy_conference_tables.py:283 for post in _filter_by_pairs(post_model.objects, "post_id", "account_id", chunk).defer(2 ms17.1%
QuerySet.__iter__django/db/models/query.py:4392 ms17.1%
QuerySet._fetch_alldjango/db/models/query.py:22622 ms17.1%
ModelIterable.__iter__django/db/models/query.py:1032 ms17.1%
SQLCompiler.execute_sqldjango/db/models/sql/compiler.py:16252 ms17.1%
CursorWrapper.executedjango/db/backends/utils.py:792 ms17.1%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:922 ms17.1%
CursorWrapper._executedjango/db/backends/utils.py:1052 ms17.1%
Cursor.executepsycopg/cursor.py:1132 ms17.1%
Connection.waitpsycopg/connection.py:4952 ms17.1%
BaseCursor._execute_genpsycopg/_cursor_base.py:2061 ms8.5%
BaseCursor._maybe_prepare_genpsycopg/_cursor_base.py:2861 ms8.5%
ClientCursorMixin._execute_sendpsycopg/client_cursor.py:781 ms8.5%
TransactionTestCase._post_teardowndjango/test/testcases.py:1243 self._fixture_teardown()4 ms25.6%
TestCase._fixture_teardowndjango/test/testcases.py:14984 ms25.6%
DatabaseWrapper.check_constraintsdjango/db/backends/postgresql/base.py:4962 ms17.1%
CursorWrapper.executedjango/db/backends/utils.py:792 ms17.1%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:922 ms17.1%
CursorWrapper._executedjango/db/backends/utils.py:1032 ms17.1%
Cursor.executepsycopg/cursor.py:1132 ms17.1%
Connection.waitpsycopg/connection.py:4952 ms17.1%
DatabaseWrapper.check_constraintsdjango/db/backends/postgresql/base.py:4951 ms8.5%
CursorWrapper.executedjango/db/backends/utils.py:791 ms8.5%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:921 ms8.5%
CursorWrapper._executedjango/db/backends/utils.py:1031 ms8.5%
Cursor.executepsycopg/cursor.py:1131 ms8.5%
Connection.waitpsycopg/connection.py:4951 ms8.5%
TestResolveLegacyAccountsAndPosts.test_match_existing_post_by_post_id_and_accountconfs/tests.py:352 account = baker.make(Account, username="carol")2 ms17.1%
makemodel_bakery/baker.py:1752 ms17.1%
Baker.makemodel_bakery/baker.py:4542 ms17.1%
Baker._makemodel_bakery/baker.py:5012 ms17.1%
Baker._skip_fieldmodel_bakery/baker.py:7551 ms8.5%
Baker.instancemodel_bakery/baker.py:6591 ms8.5%
Model.savedjango/db/models/base.py:9041 ms8.5%
Model.save_basedjango/db/models/base.py:9961 ms8.5%
Model._save_tabledjango/db/models/base.py:11991 ms8.5%
Model._do_insertdjango/db/models/base.py:12511 ms8.5%
BaseManager._get_queryset_methods.<locals>.create_method.<locals>.manager_methoddjango/db/models/manager.py:871 ms8.5%
QuerySet._insertdjango/db/models/query.py:21411 ms8.5%
SQLInsertCompiler.execute_sqldjango/db/models/sql/compiler.py:19361 ms8.5%
CursorWrapper.executedjango/db/backends/utils.py:791 ms8.5%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:921 ms8.5%
CursorWrapper._executedjango/db/backends/utils.py:1051 ms8.5%
Cursor.executepsycopg/cursor.py:1131 ms8.5%
Connection.waitpsycopg/connection.py:4951 ms8.5%
BaseCursor._execute_genpsycopg/_cursor_base.py:2061 ms8.5%
BaseCursor._maybe_prepare_genpsycopg/_cursor_base.py:2861 ms8.5%
ClientCursorMixin._execute_sendpsycopg/client_cursor.py:781 ms8.5%
TestResolveLegacyAccountsAndPosts.test_match_existing_post_by_post_id_and_accountconfs/tests.py:353 existing = baker.make(1 ms8.5%
makemodel_bakery/baker.py:1751 ms8.5%
Baker.makemodel_bakery/baker.py:4541 ms8.5%
Baker._makemodel_bakery/baker.py:5421 ms8.5%
Baker.instancemodel_bakery/baker.py:6591 ms8.5%
Model.savedjango/db/models/base.py:9041 ms8.5%
Model.save_basedjango/db/models/base.py:9961 ms8.5%
Model._save_tabledjango/db/models/base.py:11991 ms8.5%
Model._do_insertdjango/db/models/base.py:12511 ms8.5%
BaseManager._get_queryset_methods.<locals>.create_method.<locals>.manager_methoddjango/db/models/manager.py:871 ms8.5%
QuerySet._insertdjango/db/models/query.py:21411 ms8.5%
SQLInsertCompiler.execute_sqldjango/db/models/sql/compiler.py:19361 ms8.5%
CursorWrapper.executedjango/db/backends/utils.py:791 ms8.5%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:921 ms8.5%
CursorWrapper._executedjango/db/backends/utils.py:1051 ms8.5%
Cursor.executepsycopg/cursor.py:1131 ms8.5%
Connection.waitpsycopg/connection.py:4951 ms8.5%
BaseCursor._execute_genpsycopg/_cursor_base.py:2061 ms8.5%
BaseCursor._maybe_prepare_genpsycopg/_cursor_base.py:2861 ms8.5%
ClientCursorMixin._execute_sendpsycopg/client_cursor.py:781 ms8.5%
TestResolveLegacyAccountsAndPosts.test_match_existing_post_by_post_id_and_accountconfs/tests.py:373 self.assertEqual(Post.objects.filter(account=account).count(), 1)1 ms8.5%
QuerySet.countdjango/db/models/query.py:6771 ms8.5%
Query.get_countdjango/db/models/sql/query.py:6571 ms8.5%
Query.get_aggregationdjango/db/models/sql/query.py:6391 ms8.5%
SQLCompiler.execute_sqldjango/db/models/sql/compiler.py:16251 ms8.5%
CursorWrapper.executedjango/db/backends/utils.py:791 ms8.5%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:921 ms8.5%
CursorWrapper._executedjango/db/backends/utils.py:1051 ms8.5%
Cursor.executepsycopg/cursor.py:1131 ms8.5%
Connection.waitpsycopg/connection.py:4951 ms8.5%
Estimated from 12 samples; phase durations are exact. Frames from pytest and pluggy are
hidden
.
Hot lines in your code
|
confs/tests.py:352
account = baker.make(Account, username="carol")
TestResolveLegacyAccountsAndPosts.test_match_existing_post_by_post_id_and_account
· Factories
|
2 ms |
|
confs/migrations/0033_remove_legacy_conference_tables.py:279
post_model.objects.bulk_create(to_create, ignore_conflicts=True, batch_size=IN_CHUNK_SIZE)
_resolve_posts
· Database
|
2 ms |
|
confs/migrations/0033_remove_legacy_conference_tables.py:283
for post in _filter_by_pairs(post_model.objects, "post_id", "account_id", chunk).defer(
_resolve_posts
· Database
|
2 ms |
|
confs/tests.py:353
existing = baker.make(
TestResolveLegacyAccountsAndPosts.test_match_existing_post_by_post_id_and_account
· Database
|
1 ms |
|
confs/tests.py:373
self.assertEqual(Post.objects.filter(account=account).count(), 1)
TestResolveLegacyAccountsAndPosts.test_match_existing_post_by_post_id_and_account
· Database
|
1 ms |
Fixtures
Exact setup time| _template_string_if_invalid_marker function | 0.04 ms |
| _django_db_marker function | 0.03 ms |
| _dj_autoclear_mailbox function | 0.03 ms |
| _live_server_helper function | 0.03 ms |
| _django_isolate_apps function | 0.03 ms |
| _django_set_urlconf function | 0.03 ms |
| _django_clear_site_cache function | 0.02 ms |
| monkeypatch function | 0.02 ms |
Database
10 queries · 8 msNo repeated queries.
Biggest pieces of work
|
call test body
confs/tests.py:352
|
10 ms |
|
call _post_teardown
django/test/testcases.py:1243
|
4 ms |
|
setup __init__
__init__:-1
|
0.69 ms |
Reliability
14 results · 0 CI failures · 0 local failuresThis test hasn't failed recently.
History
Latest 14 results, oldest first in the strip| When | Environment | Outcome | Duration | |
|---|---|---|---|---|
| 2 weeks ago | CI github-actions:test | passed | 14 ms | Profile |
| 2 weeks, 5 days ago | CI github-actions:test | passed | 15 ms | Profile |
| 2 weeks, 6 days ago | CI github-actions:test | passed | 19 ms | Profile |
| 3 weeks ago | CI github-actions:test | passed | 10 ms | Profile |
| 3 weeks ago | CI github-actions:test | passed | 22 ms | Profile |
| 1 month ago | CI github-actions:test | passed | 21 ms | Profile |
| 1 month ago | CI github-actions:test | passed | 19 ms | Profile |
| 1 month ago | CI github-actions:test | passed | 18 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 | 17 ms | Profile |
| 1 month, 1 week ago | CI github-actions:test | passed | 42 ms | Profile |
| 1 month, 1 week ago | CI github-actions:test | passed | 36 ms | Profile |
| 1 month, 1 week ago | CI github-actions:test | passed | 33 ms | Profile |
| 1 month, 1 week ago | CI github-actions:test | passed | 11 ms | Run |