Tests / accounts/tests.py
TestSelectedInstance::test_selected_instance_http_truncate
First seen 2 years, 11 months ago in 1cd3a8d
CI
github-actions:test
11 runs
Average
155 ms
median 140 ms
max 292 ms
max 292 ms
Phases
Setup 3 ms
Call 152 ms
Teardown 0.41 ms
Categories
Database 22 ms
App code 0.15 ms
Other (Libraries, Templates, pytest, Unsampled) 132 ms
13 database queries per run
Needs 508 KB of memory (max 732 KB)
Duration per run
Where the time goes
Latest run in ci:github-actions:test, 7 hours ago ·
open run
setup6 ms4.5%
isasyncgenfunction<stdlib>/inspect.py:344 return _has_code_flag(obj, CO_ASYNC_GENERATOR)6 ms4.5%
_has_code_flag<stdlib>/inspect.py:3036 ms4.5%
call131 ms95.1%
TestSelectedInstance.test_selected_instance_http_truncateaccounts/tests.py:217 response = self.client.get("/?selected_instance=https://mastodon.social")123 ms89.7%
Client.getdjango/test/client.py:1133123 ms89.7%
RequestFactory.getdjango/test/client.py:475123 ms89.7%
RequestFactory.genericdjango/test/client.py:671123 ms89.7%
Client.requestdjango/test/client.py:1091123 ms89.7%
ClientHandler.__call__django/test/client.py:17390 ms65.6%
BaseHandler.load_middlewaredjango/core/handlers/base.py:6390 ms65.6%
WhiteNoiseMiddleware.__init__whitenoise/middleware.py:10490 ms65.6%
WhiteNoise.add_fileswhitenoise/base.py:10890 ms65.6%
WhiteNoise.update_files_dictionarywhitenoise/base.py:12066 ms48.1%
WhiteNoise.add_file_to_dictionarywhitenoise/base.py:13165 ms47.0%
WhiteNoise.get_static_filewhitenoise/base.py:21763 ms45.9%
StaticFile.__init__whitenoise/responders.py:7426 ms18.6%
Headers.__getitem__<stdlib>/wsgiref/headers.py:8326 ms18.6%
Headers.get<stdlib>/wsgiref/headers.py:10626 ms18.6%
StaticFile.__init__whitenoise/responders.py:7621 ms15.3%
StaticFile.get_not_modified_responsewhitenoise/responders.py:18821 ms15.3%
Headers.__contains__<stdlib>/wsgiref/headers.py:8720 ms14.2%
Headers.get<stdlib>/wsgiref/headers.py:10617 ms12.0%
Headers.get<stdlib>/wsgiref/headers.py:1052 ms1.1%
URLMixin.urldebug_toolbar/panels/staticfiles.py:202 ms1.1%
HashedFilesMixin.urldjango/contrib/staticfiles/storage.py:2352 ms1.1%
HashedFilesMixin._urldjango/contrib/staticfiles/storage.py:2162 ms1.1%
FileSystemStorage.urldjango/core/files/storage/filesystem.py:2042 ms1.1%
StaticFile.__init__whitenoise/responders.py:739 ms6.6%
StaticFile.get_headerswhitenoise/responders.py:1766 ms4.4%
formatdate<stdlib>/email/utils.py:2666 ms4.4%
format_datetime<stdlib>/email/utils.py:2843 ms2.2%
StaticFile.get_headerswhitenoise/responders.py:1783 ms2.2%
parsedate<stdlib>/email/_parseaddr.py:1853 ms2.2%
parsedate_tz<stdlib>/email/_parseaddr.py:503 ms2.2%
_parsedate_tz<stdlib>/email/_parseaddr.py:1083 ms2.2%
StaticFile.__init__whitenoise/responders.py:775 ms3.3%
StaticFile.get_alternativeswhitenoise/responders.py:2003 ms2.2%
__init____init__:-12 ms1.1%
Headers.__init__<stdlib>/wsgiref/headers.py:362 ms1.1%
StaticFile.get_alternativeswhitenoise/responders.py:2032 ms1.1%
Headers.__setitem__<stdlib>/wsgiref/headers.py:622 ms1.1%
Headers.__init__<stdlib>/wsgiref/headers.py:432 ms1.1%
StaticFile.__init__whitenoise/responders.py:723 ms2.2%
StaticFile.get_file_statswhitenoise/responders.py:1613 ms2.2%
WhiteNoise.get_static_filewhitenoise/base.py:2122 ms1.1%
WhiteNoise.add_cache_headerswhitenoise/base.py:2332 ms1.1%
WhiteNoiseMiddleware.immutable_file_testwhitenoise/middleware.py:1762 ms1.1%
WhiteNoiseMiddleware.get_static_urlwhitenoise/middleware.py:1972 ms1.1%
WhiteNoise.update_files_dictionarywhitenoise/base.py:11524 ms17.5%
scantreewhitenoise/base.py:27121 ms15.3%
scantreewhitenoise/base.py:27117 ms12.0%
scantreewhitenoise/base.py:27111 ms7.7%
scantreewhitenoise/base.py:27111 ms7.7%
scantreewhitenoise/base.py:2716 ms4.4%
scantreewhitenoise/base.py:2736 ms4.4%
scantreewhitenoise/base.py:2735 ms3.3%
scantreewhitenoise/base.py:2736 ms4.4%
scantreewhitenoise/base.py:2735 ms3.3%
scantreewhitenoise/base.py:2733 ms2.2%
ClientHandler.__call__django/test/client.py:18633 ms24.1%
BaseHandler.get_responsedjango/core/handlers/base.py:14233 ms24.1%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5633 ms24.1%
MiddlewareMixin.__call__django/utils/deprecation.py:38033 ms24.1%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5633 ms24.1%
MiddlewareMixin.__call__django/utils/deprecation.py:38033 ms24.1%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5633 ms24.1%
MiddlewareMixin.__call__django/utils/deprecation.py:38033 ms24.1%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5633 ms24.1%
WhiteNoiseMiddleware.__call__whitenoise/middleware.py:12333 ms24.1%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5633 ms24.1%
DebugToolbarMiddleware.__call__debug_toolbar/middleware.py:14533 ms24.1%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5633 ms24.1%
MiddlewareMixin.__call__django/utils/deprecation.py:38030 ms21.9%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5630 ms21.9%
MiddlewareMixin.__call__django/utils/deprecation.py:38030 ms21.9%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5630 ms21.9%
MiddlewareMixin.__call__django/utils/deprecation.py:38030 ms21.9%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5630 ms21.9%
MiddlewareMixin.__call__django/utils/deprecation.py:38030 ms21.9%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5630 ms21.9%
MiddlewareMixin.__call__django/utils/deprecation.py:38030 ms21.9%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5630 ms21.9%
MiddlewareMixin.__call__django/utils/deprecation.py:38030 ms21.9%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5630 ms21.9%
MiddlewareMixin.__call__django/utils/deprecation.py:38030 ms21.9%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:5630 ms21.9%
BaseHandler._get_responsedjango/core/handlers/base.py:19930 ms21.9%
indexaccounts/views.py:425 return render(30 ms21.9%
renderdjango/shortcuts.py:2730 ms21.9%
render_to_stringdjango/template/loader.py:6230 ms21.9%
Template.renderdjango/template/backends/django.py:10730 ms21.9%
Template.renderdjango/template/base.py:17530 ms21.9%
instrumented_test_renderdjango/test/utils.py:11330 ms21.9%
NodeList.renderdjango/template/base.py:110830 ms21.9%
Node.render_annotateddjango/template/base.py:106930 ms21.9%
ExtendsNode.renderdjango/template/loader_tags.py:16030 ms21.9%
instrumented_test_renderdjango/test/utils.py:11330 ms21.9%
NodeList.renderdjango/template/base.py:110830 ms21.9%
Node.render_annotateddjango/template/base.py:106930 ms21.9%
BlockNode.renderdjango/template/loader_tags.py:6629 ms20.8%
NodeList.renderdjango/template/base.py:110829 ms20.8%
Node.render_annotateddjango/template/base.py:106929 ms20.8%
ForNode.renderdjango/template/defaulttags.py:24929 ms20.8%
Node.render_annotateddjango/template/base.py:106927 ms19.7%
IfNode.renderdjango/template/defaulttags.py:3266 ms4.4%
infix.<locals>.Operator.evaldjango/template/smartif.py:616 ms4.4%
<lambda>django/template/smartif.py:1065 ms3.3%
TemplateLiteral.evaldjango/template/defaulttags.py:9185 ms3.3%
FilterExpression.resolvedjango/template/base.py:8065 ms3.3%
Variable.resolvedjango/template/base.py:9453 ms2.2%
Variable._resolve_lookupdjango/template/base.py:10432 ms1.1%
Variable._resolve_lookupdjango/template/base.py:10042 ms1.1%
<lambda>django/template/smartif.py:1072 ms1.1%
TemplateLiteral.evaldjango/template/defaulttags.py:9182 ms1.1%
FilterExpression.resolvedjango/template/base.py:8062 ms1.1%
Variable.resolvedjango/template/base.py:9452 ms1.1%
Variable._resolve_lookupdjango/template/base.py:9802 ms1.1%
StaticNode.renderdjango/templatetags/static.py:1165 ms3.3%
StaticNode.urldjango/templatetags/static.py:1135 ms3.3%
StaticNode.handle_simpledjango/templatetags/static.py:1295 ms3.3%
URLMixin.urldebug_toolbar/panels/staticfiles.py:205 ms3.3%
HashedFilesMixin.urldjango/contrib/staticfiles/storage.py:2353 ms2.2%
HashedFilesMixin._urldjango/contrib/staticfiles/storage.py:2163 ms2.2%
FileSystemStorage.urldjango/core/files/storage/filesystem.py:2073 ms2.2%
urljoin<stdlib>/urllib/parse.py:7653 ms2.2%
SimpleNode.renderdjango/template/library.py:3433 ms2.2%
querystringdjango/template/defaulttags.py:13482 ms1.1%
QueryDict.urlencodedjango/http/request.py:7442 ms1.1%
querystringdjango/template/defaulttags.py:13292 ms1.1%
ABCMeta.__instancecheck__<frozen abc>:1192 ms1.1%
IfNode.renderdjango/template/defaulttags.py:3332 ms1.1%
NodeList.renderdjango/template/base.py:11082 ms1.1%
Node.render_annotateddjango/template/base.py:10692 ms1.1%
URLNode.renderdjango/template/defaulttags.py:5112 ms1.1%
reversedjango/urls/base.py:442 ms1.1%
get_script_prefixdjango/urls/base.py:1352 ms1.1%
Local.__getattr__asgiref/local.py:1572 ms1.1%
StaticNode.renderdjango/templatetags/static.py:1162 ms1.1%
StaticNode.urldjango/templatetags/static.py:1132 ms1.1%
StaticNode.handle_simpledjango/templatetags/static.py:1292 ms1.1%
URLMixin.urldebug_toolbar/panels/staticfiles.py:202 ms1.1%
MiddlewareMixin.__call__django/utils/deprecation.py:3823 ms2.2%
SessionMiddleware.process_responsedjango/contrib/sessions/middleware.py:603 ms2.2%
SessionStore.savedjango/contrib/sessions/backends/db.py:1213 ms2.2%
SessionStore.createdjango/contrib/sessions/backends/db.py:702 ms1.1%
SessionBase._get_new_session_keydjango/contrib/sessions/backends/base.py:2012 ms1.1%
SessionStore.existsdjango/contrib/sessions/backends/db.py:632 ms1.1%
BaseManager._get_queryset_methods.<locals>.create_method.<locals>.manager_methoddjango/db/models/manager.py:872 ms1.1%
QuerySet.filterdjango/db/models/query.py:16762 ms1.1%
QuerySet._filter_or_excludedjango/db/models/query.py:16942 ms1.1%
QuerySet._filter_or_exclude_inplacedjango/db/models/query.py:17042 ms1.1%
Query.add_qdjango/db/models/sql/query.py:16812 ms1.1%
Query._add_qdjango/db/models/sql/query.py:17132 ms1.1%
Query.build_filterdjango/db/models/sql/query.py:16132 ms1.1%
SessionStore.createdjango/contrib/sessions/backends/db.py:742 ms1.1%
SessionStore.savedjango/contrib/sessions/backends/db.py:1232 ms1.1%
SessionStore.create_model_instancedjango/contrib/sessions/backends/db.py:1022 ms1.1%
SessionBase.encodedjango/contrib/sessions/backends/base.py:1292 ms1.1%
dumpsdjango/core/signing.py:1912 ms1.1%
Signer.sign_objectdjango/core/signing.py:2792 ms1.1%
TimestampSigner.signdjango/core/signing.py:3012 ms1.1%
Signer.signdjango/core/signing.py:2452 ms1.1%
Signer.signaturedjango/core/signing.py:2422 ms1.1%
base64_hmacdjango/core/signing.py:1142 ms1.1%
salted_hmacdjango/utils/crypto.py:612 ms1.1%
new<stdlib>/hmac.py:2372 ms1.1%
__init____init__:-12 ms1.1%
HMAC.__init__<stdlib>/hmac.py:1082 ms1.1%
HMAC.__init<stdlib>/hmac.py:1132 ms1.1%
HMAC._init_openssl_hmac<stdlib>/hmac.py:1292 ms1.1%
TransactionTestCase._pre_setupdjango/test/testcases.py:1167 cls._fixture_setup()3 ms2.2%
TestCase._fixture_setupdjango/test/testcases.py:14813 ms2.2%
TestCase._enter_atomicsdjango/test/testcases.py:13993 ms2.2%
Atomic.__enter__django/db/transaction.py:2233 ms2.2%
async_unsafe.<locals>.decorator.<locals>.innerdjango/utils/asyncio.py:263 ms2.2%
BaseDatabaseWrapper.savepointdjango/db/backends/base/base.py:4003 ms2.2%
BaseDatabaseWrapper._savepointdjango/db/backends/base/base.py:3673 ms2.2%
CursorWrapper.executedjango/db/backends/utils.py:793 ms2.2%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:923 ms2.2%
CursorWrapper._executedjango/db/backends/utils.py:1033 ms2.2%
Cursor.executepsycopg/cursor.py:1133 ms2.2%
Connection.waitpsycopg/connection.py:4953 ms2.2%
TransactionTestCase._post_teardowndjango/test/testcases.py:1243 self._fixture_teardown()3 ms2.2%
TestCase._fixture_teardowndjango/test/testcases.py:14982 ms1.1%
DatabaseWrapper.check_constraintsdjango/db/backends/postgresql/base.py:4952 ms1.1%
CursorWrapper.executedjango/db/backends/utils.py:792 ms1.1%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:922 ms1.1%
CursorWrapper._executedjango/db/backends/utils.py:1032 ms1.1%
Cursor.executepsycopg/cursor.py:1132 ms1.1%
Connection.waitpsycopg/connection.py:4952 ms1.1%
BaseCursor._execute_genpsycopg/_cursor_base.py:2062 ms1.1%
BaseCursor._maybe_prepare_genpsycopg/_cursor_base.py:2862 ms1.1%
ClientCursorMixin._execute_sendpsycopg/client_cursor.py:782 ms1.1%
TestCase._fixture_teardowndjango/test/testcases.py:15002 ms1.1%
TestCase._rollback_atomicsdjango/test/testcases.py:14082 ms1.1%
Atomic.__exit__django/db/transaction.py:2982 ms1.1%
async_unsafe.<locals>.decorator.<locals>.innerdjango/utils/asyncio.py:262 ms1.1%
BaseDatabaseWrapper.savepoint_commitdjango/db/backends/base/base.py:4312 ms1.1%
BaseDatabaseWrapper._savepoint_commitdjango/db/backends/base/base.py:3752 ms1.1%
CursorWrapper.executedjango/db/backends/utils.py:792 ms1.1%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:922 ms1.1%
CursorWrapper._executedjango/db/backends/utils.py:1032 ms1.1%
Cursor.executepsycopg/cursor.py:1132 ms1.1%
Connection.waitpsycopg/connection.py:4952 ms1.1%
BaseCursor._execute_genpsycopg/_cursor_base.py:2062 ms1.1%
BaseCursor._maybe_prepare_genpsycopg/_cursor_base.py:2862 ms1.1%
ClientCursorMixin._execute_sendpsycopg/client_cursor.py:782 ms1.1%
TestSelectedInstance.test_selected_instance_http_truncateaccounts/tests.py:220 self.assertEqual(self.client.session["selected_instance"], "mastodon.social")2 ms1.1%
SessionBase.__getitem__django/contrib/sessions/backends/base.py:552 ms1.1%
SessionBase._get_sessiondjango/contrib/sessions/backends/base.py:2542 ms1.1%
SessionStore.loaddjango/contrib/sessions/backends/db.py:552 ms1.1%
SessionStore._get_session_from_dbdjango/contrib/sessions/backends/db.py:342 ms1.1%
BaseManager._get_queryset_methods.<locals>.create_method.<locals>.manager_methoddjango/db/models/manager.py:872 ms1.1%
QuerySet.getdjango/db/models/query.py:7022 ms1.1%
QuerySet.__len__django/db/models/query.py:4212 ms1.1%
QuerySet._fetch_alldjango/db/models/query.py:22622 ms1.1%
ModelIterable.__iter__django/db/models/query.py:1032 ms1.1%
SQLCompiler.execute_sqldjango/db/models/sql/compiler.py:16252 ms1.1%
CursorWrapper.executedjango/db/backends/utils.py:792 ms1.1%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:922 ms1.1%
CursorWrapper._executedjango/db/backends/utils.py:1052 ms1.1%
Cursor.executepsycopg/cursor.py:1132 ms1.1%
Connection.waitpsycopg/connection.py:4952 ms1.1%
BaseCursor._execute_genpsycopg/_cursor_base.py:2062 ms1.1%
BaseCursor._maybe_prepare_genpsycopg/_cursor_base.py:2862 ms1.1%
ClientCursorMixin._execute_sendpsycopg/client_cursor.py:782 ms1.1%
Estimated from 95 samples; phase durations are exact. Frames from pytest and pluggy are
hidden
.
Hot lines in your code
|
accounts/tests.py:217
response = self.client.get("/?selected_instance=https://mastodon.social")
TestSelectedInstance.test_selected_instance_http_truncate
· Libraries
|
93 ms |
|
accounts/views.py:425
return render(
index
· Templates
|
30 ms |
|
accounts/tests.py:220
self.assertEqual(self.client.session["selected_instance"], "mastodon.social")
TestSelectedInstance.test_selected_instance_http_truncate
· Database
|
2 ms |
Fixtures
Exact setup time| _template_string_if_invalid_marker function | 5 ms |
| _django_set_urlconf function | 0.05 ms |
| _live_server_helper function | 0.05 ms |
| _dj_autoclear_mailbox function | 0.05 ms |
| _django_db_marker function | 0.05 ms |
| _django_isolate_apps function | 0.04 ms |
| _django_clear_site_cache function | 0.03 ms |
| monkeypatch function | 0.03 ms |
Database
13 queries · 7 msNo repeated queries.
Biggest pieces of work
|
call test body
accounts/tests.py:217
|
125 ms |
|
setup isasyncgenfunction
<stdlib>/inspect.py:344
|
6 ms |
|
call _pre_setup
django/test/testcases.py:1167
|
3 ms |
|
call _post_teardown
django/test/testcases.py:1243
|
3 ms |
Reliability
12 results · 0 CI failures · 0 local failuresThis test hasn't failed recently.
History
Latest 12 results, oldest first in the strip| When | Environment | Outcome | Duration | |
|---|---|---|---|---|
| 7 hours ago | CI github-actions:test | passed | 138 ms | Profile |
| 16 hours ago | CI github-actions:test | passed | 62 ms | Profile |
| 22 hours ago | CI github-actions:test | passed | 151 ms | Profile |
| 1 week, 5 days ago | CI github-actions:test | passed | 140 ms | Profile |
| 2 weeks, 2 days ago | CI github-actions:test | passed | 100 ms | Profile |
| 2 weeks, 2 days ago | CI github-actions:test | passed | 140 ms | Profile |
| 2 weeks, 4 days ago | CI github-actions:test | passed | 167 ms | Profile |
| 3 weeks ago | CI github-actions:test | passed | 82 ms | Profile |
| 3 weeks ago | CI github-actions:test | passed | 163 ms | Profile |
| 3 weeks ago | CI github-actions:test | passed | 292 ms | Profile |
| 3 weeks ago | CI github-actions:test | passed | 268 ms | Profile |
| 3 weeks ago | CI github-actions:test | passed | 113 ms | Run |