Tests / confs/tests.py
TestResolveLegacyAccountsAndPosts::test_creates_account_when_neither_url_nor_pair_match
First seen 1 month, 1 week ago in 0c23747
CI
github-actions:test
13 runs
Average
43 ms
median 40 ms
max 71 ms
max 71 ms
Phases
Setup 17 ms
Call 25 ms
Teardown 0.28 ms
Categories
Database 40 ms
App code 0.09 ms
Other (pytest, Unsampled, Libraries) 3 ms
12 database queries per run
Needs 1 KB of memory (max 12 KB)
Duration per run
Where the time goes
Latest run in ci:github-actions:test, 2 weeks ago ·
open run
setup13 ms34.4%
TestCase.setUpClassdjango/test/testcases.py:1426 cls.cls_atomics = cls._enter_atomics()12 ms31.2%
TestCase._enter_atomicsdjango/test/testcases.py:139912 ms31.2%
Atomic.__enter__django/db/transaction.py:21012 ms31.2%
BaseDatabaseWrapper.get_autocommitdjango/db/backends/base/base.py:45412 ms31.2%
SimpleTestCase.ensure_connection_patch_method.<locals>.patched_ensure_connectiondjango/test/testcases.py:30412 ms31.2%
async_unsafe.<locals>.decorator.<locals>.innerdjango/utils/asyncio.py:2612 ms31.2%
BaseDatabaseWrapper.ensure_connectiondjango/db/backends/base/base.py:27912 ms31.2%
async_unsafe.<locals>.decorator.<locals>.innerdjango/utils/asyncio.py:2612 ms31.2%
BaseDatabaseWrapper.connectdjango/db/backends/base/base.py:25612 ms31.2%
DatabaseWrapper.get_new_connectionfedidevs/db/postgresql/base.py:39 return super().get_new_connection(conn_params)12 ms31.2%
async_unsafe.<locals>.decorator.<locals>.innerdjango/utils/asyncio.py:2612 ms31.2%
DatabaseWrapper.get_new_connectiondjango/db/backends/postgresql/base.py:34512 ms31.2%
Connection.connectpsycopg/connection.py:10912 ms31.2%
wait_connpsycopg/waiting.py:1458 ms21.9%
BaseConnection._connect_genpsycopg/_connection_base.py:4398 ms21.9%
wait_connpsycopg/waiting.py:1412 ms6.2%
EpollSelector.select<stdlib>/selectors.py:4522 ms6.2%
wait_connpsycopg/waiting.py:1361 ms3.1%
BaseConnection._connect_genpsycopg/_connection_base.py:4391 ms3.1%
call25 ms65.2%
TestResolveLegacyAccountsAndPosts.test_creates_account_when_neither_url_nor_pair_matchconfs/tests.py:302 resolve = _legacy_migration()._resolve_accounts(14 ms35.3%
_resolve_accountsconfs/migrations/0033_remove_legacy_conference_tables.py:233 for account in _filter_by_pairs(lookup, "account_id", "instance", chunk):9 ms24.5%
QuerySet.__iter__django/db/models/query.py:4399 ms24.5%
QuerySet._fetch_alldjango/db/models/query.py:22629 ms24.5%
ModelIterable.__iter__django/db/models/query.py:1039 ms24.5%
SQLCompiler.execute_sqldjango/db/models/sql/compiler.py:16259 ms24.5%
CursorWrapper.executedjango/db/backends/utils.py:799 ms24.5%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:929 ms24.5%
CursorWrapper._executedjango/db/backends/utils.py:1059 ms24.5%
Cursor.executepsycopg/cursor.py:1139 ms24.5%
Connection.waitpsycopg/connection.py:4959 ms24.5%
_resolve_accountsconfs/migrations/0033_remove_legacy_conference_tables.py:253 _index_accounts(by_url, by_pair, lookup.filter(url__in=chunk))2 ms5.4%
QuerySet.filterdjango/db/models/query.py:16761 ms2.7%
QuerySet._filter_or_excludedjango/db/models/query.py:16891 ms2.7%
_index_accountsconfs/migrations/0033_remove_legacy_conference_tables.py:194 for account in accounts:1 ms2.7%
QuerySet.__iter__django/db/models/query.py:4391 ms2.7%
QuerySet._fetch_alldjango/db/models/query.py:22621 ms2.7%
ModelIterable.__iter__django/db/models/query.py:1031 ms2.7%
SQLCompiler.execute_sqldjango/db/models/sql/compiler.py:16121 ms2.7%
SQLCompiler.as_sqldjango/db/models/sql/compiler.py:7681 ms2.7%
SQLCompiler.pre_sql_setupdjango/db/models/sql/compiler.py:891 ms2.7%
SQLCompiler.setup_querydjango/db/models/sql/compiler.py:781 ms2.7%
SQLCompiler.get_selectdjango/db/models/sql/compiler.py:2651 ms2.7%
SQLCompiler.get_default_columnsdjango/db/models/sql/compiler.py:10021 ms2.7%
_resolve_accountsconfs/migrations/0033_remove_legacy_conference_tables.py:250 account_model.objects.bulk_create(to_create, ignore_conflicts=True, batch_size=IN_CHUNK_SIZE)1 ms2.7%
BaseManager._get_queryset_methods.<locals>.create_method.<locals>.manager_methoddjango/db/models/manager.py:871 ms2.7%
QuerySet.bulk_createdjango/db/models/query.py:9001 ms2.7%
QuerySet._batched_insertdjango/db/models/query.py:21791 ms2.7%
QuerySet._insertdjango/db/models/query.py:21411 ms2.7%
SQLInsertCompiler.execute_sqldjango/db/models/sql/compiler.py:19361 ms2.7%
CursorWrapper.executedjango/db/backends/utils.py:791 ms2.7%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:921 ms2.7%
CursorWrapper._executedjango/db/backends/utils.py:1051 ms2.7%
Cursor.executepsycopg/cursor.py:1131 ms2.7%
Connection.waitpsycopg/connection.py:4951 ms2.7%
_resolve_accountsconfs/migrations/0033_remove_legacy_conference_tables.py:256 for account in _filter_by_pairs(lookup, "account_id", "instance", chunk):1 ms2.7%
QuerySet.__iter__django/db/models/query.py:4391 ms2.7%
QuerySet._fetch_alldjango/db/models/query.py:22621 ms2.7%
ModelIterable.__iter__django/db/models/query.py:1031 ms2.7%
SQLCompiler.execute_sqldjango/db/models/sql/compiler.py:16121 ms2.7%
SQLCompiler.as_sqldjango/db/models/sql/compiler.py:7681 ms2.7%
SQLCompiler.pre_sql_setupdjango/db/models/sql/compiler.py:891 ms2.7%
SQLCompiler.setup_querydjango/db/models/sql/compiler.py:781 ms2.7%
SQLCompiler.get_selectdjango/db/models/sql/compiler.py:2651 ms2.7%
SQLCompiler.get_default_columnsdjango/db/models/sql/compiler.py:10281 ms2.7%
<unknown function><unknown file>1 ms2.7%
Field.__hash__django/db/models/fields/__init__.py:7441 ms2.7%
TransactionTestCase._post_teardowndjango/test/testcases.py:1243 self._fixture_teardown()4 ms10.9%
TestCase._fixture_teardowndjango/test/testcases.py:15003 ms8.2%
TestCase._rollback_atomicsdjango/test/testcases.py:14083 ms8.2%
Atomic.__exit__django/db/transaction.py:2982 ms5.4%
async_unsafe.<locals>.decorator.<locals>.innerdjango/utils/asyncio.py:262 ms5.4%
BaseDatabaseWrapper.savepoint_commitdjango/db/backends/base/base.py:4312 ms5.4%
BaseDatabaseWrapper._savepoint_commitdjango/db/backends/base/base.py:3752 ms5.4%
CursorWrapper.executedjango/db/backends/utils.py:792 ms5.4%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:922 ms5.4%
CursorWrapper._executedjango/db/backends/utils.py:1032 ms5.4%
Cursor.executepsycopg/cursor.py:1132 ms5.4%
Connection.waitpsycopg/connection.py:4952 ms5.4%
Atomic.__exit__django/db/transaction.py:2951 ms2.7%
async_unsafe.<locals>.decorator.<locals>.innerdjango/utils/asyncio.py:261 ms2.7%
BaseDatabaseWrapper.savepoint_rollbackdjango/db/backends/base/base.py:4131 ms2.7%
BaseDatabaseWrapper._savepoint_rollbackdjango/db/backends/base/base.py:3711 ms2.7%
CursorWrapper.executedjango/db/backends/utils.py:791 ms2.7%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:921 ms2.7%
CursorWrapper._executedjango/db/backends/utils.py:1031 ms2.7%
Cursor.executepsycopg/cursor.py:1131 ms2.7%
Connection.waitpsycopg/connection.py:4951 ms2.7%
TestCase._fixture_teardowndjango/test/testcases.py:14981 ms2.7%
DatabaseWrapper.check_constraintsdjango/db/backends/postgresql/base.py:4951 ms2.7%
CursorWrapper.executedjango/db/backends/utils.py:791 ms2.7%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:921 ms2.7%
CursorWrapper._executedjango/db/backends/utils.py:1031 ms2.7%
Cursor.executepsycopg/cursor.py:1131 ms2.7%
Connection.waitpsycopg/connection.py:4951 ms2.7%
BaseCursor._execute_genpsycopg/_cursor_base.py:2061 ms2.7%
BaseCursor._maybe_prepare_genpsycopg/_cursor_base.py:2861 ms2.7%
ClientCursorMixin._execute_sendpsycopg/client_cursor.py:781 ms2.7%
TransactionTestCase._pre_setupdjango/test/testcases.py:1167 cls._fixture_setup()3 ms8.2%
TestCase._fixture_setupdjango/test/testcases.py:14813 ms8.2%
TestCase._enter_atomicsdjango/test/testcases.py:13993 ms8.2%
Atomic.__enter__django/db/transaction.py:2233 ms8.2%
async_unsafe.<locals>.decorator.<locals>.innerdjango/utils/asyncio.py:263 ms8.2%
BaseDatabaseWrapper.savepointdjango/db/backends/base/base.py:4003 ms8.2%
BaseDatabaseWrapper._savepointdjango/db/backends/base/base.py:3673 ms8.2%
CursorWrapper.executedjango/db/backends/utils.py:793 ms8.2%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:923 ms8.2%
CursorWrapper._executedjango/db/backends/utils.py:1033 ms8.2%
Cursor.executepsycopg/cursor.py:1133 ms8.2%
Connection.waitpsycopg/connection.py:4953 ms8.2%
TestResolveLegacyAccountsAndPosts.test_creates_account_when_neither_url_nor_pair_matchconfs/tests.py:317 self.assertEqual(matched.username, "newuser")3 ms8.2%
DeferredAttribute.__get__django/db/models/query_utils.py:2793 ms8.2%
FetchOne.fetchdjango/db/models/fetch_modes.py:173 ms8.2%
DeferredAttribute.fetch_onedjango/db/models/query_utils.py:2973 ms8.2%
Model.refresh_from_dbdjango/db/models/base.py:7883 ms8.2%
QuerySet.getdjango/db/models/query.py:7023 ms8.2%
QuerySet.__len__django/db/models/query.py:4213 ms8.2%
QuerySet._fetch_alldjango/db/models/query.py:22623 ms8.2%
ModelIterable.__iter__django/db/models/query.py:1033 ms8.2%
SQLCompiler.execute_sqldjango/db/models/sql/compiler.py:16253 ms8.2%
CursorWrapper.executedjango/db/backends/utils.py:793 ms8.2%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:923 ms8.2%
CursorWrapper._executedjango/db/backends/utils.py:1053 ms8.2%
Cursor.executepsycopg/cursor.py:1133 ms8.2%
Connection.waitpsycopg/connection.py:4953 ms8.2%
TestResolveLegacyAccountsAndPosts.test_creates_account_when_neither_url_nor_pair_matchconfs/tests.py:318 self.assertEqual(Account.objects.filter(url="https://fosstodon.org/@newuser").count(), 1)1 ms2.7%
QuerySet.countdjango/db/models/query.py:6771 ms2.7%
Query.get_countdjango/db/models/sql/query.py:6571 ms2.7%
Query.get_aggregationdjango/db/models/sql/query.py:6391 ms2.7%
SQLCompiler.execute_sqldjango/db/models/sql/compiler.py:16251 ms2.7%
CursorWrapper.executedjango/db/backends/utils.py:791 ms2.7%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:921 ms2.7%
CursorWrapper._executedjango/db/backends/utils.py:1051 ms2.7%
Cursor.executepsycopg/cursor.py:1131 ms2.7%
Connection.waitpsycopg/connection.py:4951 ms2.7%
Estimated from 35 samples; phase durations are exact. Frames from pytest and pluggy are
hidden
.
Hot lines in your code
|
fedidevs/db/postgresql/base.py:39
return super().get_new_connection(conn_params)
DatabaseWrapper.get_new_connection
· Database
|
12 ms |
|
confs/migrations/0033_remove_legacy_conference_tables.py:233
for account in _filter_by_pairs(lookup, "account_id", "instance", chunk):
_resolve_accounts
· Database
|
9 ms |
|
confs/tests.py:317
self.assertEqual(matched.username, "newuser")
TestResolveLegacyAccountsAndPosts.test_creates_account_when_neither_url_nor_pair_match
· Database
|
3 ms |
|
confs/migrations/0033_remove_legacy_conference_tables.py:250
account_model.objects.bulk_create(to_create, ignore_conflicts=True, batch_size=IN_CHUNK_SIZE)
_resolve_accounts
· Database
|
1 ms |
|
confs/migrations/0033_remove_legacy_conference_tables.py:253
_index_accounts(by_url, by_pair, lookup.filter(url__in=chunk))
_resolve_accounts
· Database
|
1 ms |
|
confs/migrations/0033_remove_legacy_conference_tables.py:194
for account in accounts:
_index_accounts
· Database
|
1 ms |
|
confs/migrations/0033_remove_legacy_conference_tables.py:256
for account in _filter_by_pairs(lookup, "account_id", "instance", chunk):
_resolve_accounts
· Database
|
1 ms |
|
confs/tests.py:318
self.assertEqual(Account.objects.filter(url="https://fosstodon.org/@newuser").count(), 1)
TestResolveLegacyAccountsAndPosts.test_creates_account_when_neither_url_nor_pair_match
· Database
|
1 ms |
Fixtures
Exact setup time| _unittest_setUpClass_fixture_TestResolveLegacyAccountsAndPosts class | 12 ms |
| _django_setup_unittest class | 0.28 ms |
| _django_db_marker function | 0.04 ms |
| _template_string_if_invalid_marker function | 0.04 ms |
| _django_isolate_apps function | 0.04 ms |
| _dj_autoclear_mailbox function | 0.04 ms |
| _live_server_helper function | 0.04 ms |
| _django_set_urlconf function | 0.03 ms |
| _django_clear_site_cache function | 0.03 ms |
| monkeypatch function | 0.02 ms |
Database
12 queries · 19 msNo repeated queries.
Biggest pieces of work
|
call test body
confs/tests.py:302
|
18 ms |
|
setup setUpClass
django/test/testcases.py:1426
|
12 ms |
|
call _post_teardown
django/test/testcases.py:1243
|
4 ms |
|
call _pre_setup
django/test/testcases.py:1167
|
3 ms |
| setup pytest internals | 1 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 | 38 ms | Profile |
| 2 weeks, 5 days ago | CI github-actions:test | passed | 51 ms | Profile |
| 2 weeks, 6 days ago | CI github-actions:test | passed | 53 ms | Profile |
| 3 weeks ago | CI github-actions:test | passed | 24 ms | Profile |
| 3 weeks ago | CI github-actions:test | passed | 40 ms | Profile |
| 1 month ago | CI github-actions:test | passed | 35 ms | Profile |
| 1 month ago | CI github-actions:test | passed | 30 ms | Profile |
| 1 month ago | CI github-actions:test | passed | 44 ms | Profile |
| 1 month, 1 week ago | CI github-actions:test | passed | 50 ms | Profile |
| 1 month, 1 week ago | CI github-actions:test | passed | 26 ms | Profile |
| 1 month, 1 week ago | CI github-actions:test | passed | 71 ms | Profile |
| 1 month, 1 week ago | CI github-actions:test | passed | 62 ms | Profile |
| 1 month, 1 week ago | CI github-actions:test | passed | 32 ms | Profile |
| 1 month, 1 week ago | CI github-actions:test | passed | 17 ms | Run |