Tests / apps/projects/tests.py
ProjectPagesTest::test_htmx_refresh
First seen 8 hours ago in 78a4357
CI
github-actions:test
5 runs
Average
54 ms
median 59 ms
max 60 ms
max 60 ms
Phases
Setup 0.70 ms
Call 53 ms
Teardown 0.18 ms
Categories
Database 26 ms
Other (Libraries, Unsampled, pytest) 27 ms
30 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, 45 minutes ago ·
open run
setup0.84 ms1.4%
call59 ms98.3%
ProjectPagesTest.test_htmx_refreshapps/projects/tests.py:1129 response = self.client.get(self.project.url("htmx_refresh"))36 ms61.0%
Client.getdjango/test/client.py:112436 ms61.0%
RequestFactory.getdjango/test/client.py:47536 ms61.0%
RequestFactory.genericdjango/test/client.py:67136 ms61.0%
Client.requestdjango/test/client.py:108236 ms61.0%
ClientHandler.__call__django/test/client.py:17334 ms57.6%
BaseHandler.load_middlewaredjango/core/handlers/base.py:6234 ms57.6%
WhiteNoiseMiddleware.__init__whitenoise/middleware.py:10434 ms57.6%
WhiteNoise.add_fileswhitenoise/base.py:10834 ms57.6%
WhiteNoise.update_files_dictionarywhitenoise/base.py:12026 ms44.1%
WhiteNoise.add_file_to_dictionarywhitenoise/base.py:13126 ms44.1%
WhiteNoise.get_static_filewhitenoise/base.py:20824 ms40.7%
StaticFile.__init__whitenoise/responders.py:7712 ms20.3%
StaticFile.get_alternativeswhitenoise/responders.py:20712 ms20.3%
Headers.items<stdlib>/wsgiref/headers.py:13112 ms20.3%
<GC>~12 ms20.3%
StaticFile.__init__whitenoise/responders.py:738 ms13.6%
StaticFile.get_headerswhitenoise/responders.py:1764 ms6.8%
formatdate<stdlib>/email/utils.py:2664 ms6.8%
StaticFile.get_headerswhitenoise/responders.py:1782 ms3.4%
StaticFile.get_headerswhitenoise/responders.py:1672 ms3.4%
StaticFile.__init__whitenoise/responders.py:762 ms3.4%
StaticFile.get_not_modified_responsewhitenoise/responders.py:1892 ms3.4%
Headers.__getitem__<stdlib>/wsgiref/headers.py:832 ms3.4%
Headers.get<stdlib>/wsgiref/headers.py:1042 ms3.4%
Headers._convert_string_type<stdlib>/wsgiref/headers.py:502 ms3.4%
WhiteNoise.get_static_filewhitenoise/base.py:2032 ms3.4%
WhiteNoise.add_cache_headerswhitenoise/base.py:2242 ms3.4%
WhiteNoiseMiddleware.immutable_file_testwhitenoise/middleware.py:1762 ms3.4%
WhiteNoiseMiddleware.get_static_urlwhitenoise/middleware.py:1972 ms3.4%
URLMixin.urldebug_toolbar/panels/staticfiles.py:202 ms3.4%
HashedFilesMixin.urldjango/contrib/staticfiles/storage.py:2052 ms3.4%
HashedFilesMixin._urldjango/contrib/staticfiles/storage.py:1862 ms3.4%
WhiteNoise.update_files_dictionarywhitenoise/base.py:1156 ms10.2%
scantreewhitenoise/base.py:2624 ms6.8%
scantreewhitenoise/base.py:2624 ms6.8%
scantreewhitenoise/base.py:2612 ms3.4%
scantreewhitenoise/base.py:2642 ms3.4%
ClientHandler.__call__django/test/client.py:1862 ms3.4%
BaseHandler.get_responsedjango/core/handlers/base.py:1412 ms3.4%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:552 ms3.4%
DebugToolbarMiddleware.__call__debug_toolbar/middleware.py:1302 ms3.4%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:552 ms3.4%
MiddlewareMixin.__call__django/utils/deprecation.py:3092 ms3.4%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:552 ms3.4%
WhiteNoiseMiddleware.__call__whitenoise/middleware.py:1232 ms3.4%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:552 ms3.4%
MiddlewareMixin.__call__django/utils/deprecation.py:3092 ms3.4%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:552 ms3.4%
MiddlewareMixin.__call__django/utils/deprecation.py:3092 ms3.4%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:552 ms3.4%
MiddlewareMixin.__call__django/utils/deprecation.py:3092 ms3.4%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:552 ms3.4%
MiddlewareMixin.__call__django/utils/deprecation.py:3092 ms3.4%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:552 ms3.4%
MiddlewareMixin.__call__django/utils/deprecation.py:3092 ms3.4%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:552 ms3.4%
MiddlewareMixin.__call__django/utils/deprecation.py:3092 ms3.4%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:552 ms3.4%
AccountMiddleware.<locals>.middlewareallauth/account/middleware.py:342 ms3.4%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:552 ms3.4%
BaseHandler._get_responsedjango/core/handlers/base.py:1982 ms3.4%
user_passes_test.<locals>.decorator.<locals>._view_wrapperdjango/contrib/auth/decorators.py:592 ms3.4%
htmx_refreshapps/projects/urls.py:613 TestRun.objects.filter(test__project=project).exists() or Profile.objects.filter(project=project).exists()2 ms3.4%
QuerySet.existsdjango/db/models/query.py:13372 ms3.4%
Query.has_resultsdjango/db/models/sql/query.py:6812 ms3.4%
SQLCompiler.has_resultsdjango/db/models/sql/compiler.py:15922 ms3.4%
SQLCompiler.execute_sqldjango/db/models/sql/compiler.py:16112 ms3.4%
SQLCompiler.as_sqldjango/db/models/sql/compiler.py:7922 ms3.4%
SQLCompiler.get_from_clausedjango/db/models/sql/compiler.py:11592 ms3.4%
SQLCompiler.compiledjango/db/models/sql/compiler.py:5782 ms3.4%
Join.as_sqldjango/db/models/sql/datastructures.py:882 ms3.4%
DatabaseOperations.prepare_join_on_clausedjango/db/backends/postgresql/operations.py:3992 ms3.4%
ForeignKey.db_typedjango/db/models/fields/related.py:12232 ms3.4%
TransactionTestCase._post_teardowndjango/test/testcases.py:1240 self._fixture_teardown()8 ms13.6%
TestCase._fixture_teardowndjango/test/testcases.py:14956 ms10.2%
DatabaseWrapper.check_constraintsdjango/db/backends/postgresql/base.py:4836 ms10.2%
CursorWrapper.executedjango/db/backends/utils.py:796 ms10.2%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:926 ms10.2%
CursorWrapper._executedjango/db/backends/utils.py:1036 ms10.2%
Cursor.executepsycopg/cursor.py:1136 ms10.2%
Connection.waitpsycopg/connection.py:4956 ms10.2%
TestCase._fixture_teardowndjango/test/testcases.py:14972 ms3.4%
TestCase._rollback_atomicsdjango/test/testcases.py:14052 ms3.4%
Atomic.__exit__django/db/transaction.py:2862 ms3.4%
async_unsafe.<locals>.decorator.<locals>.innerdjango/utils/asyncio.py:262 ms3.4%
BaseDatabaseWrapper.savepoint_commitdjango/db/backends/base/base.py:4312 ms3.4%
BaseDatabaseWrapper._savepoint_commitdjango/db/backends/base/base.py:3752 ms3.4%
CursorWrapper.executedjango/db/backends/utils.py:792 ms3.4%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:922 ms3.4%
CursorWrapper._executedjango/db/backends/utils.py:1032 ms3.4%
Cursor.executepsycopg/cursor.py:1132 ms3.4%
Connection.waitpsycopg/connection.py:4952 ms3.4%
ProjectPagesTest.setUpapps/projects/tests.py:953 self.client.force_login(self.user)8 ms13.6%
ClientMixin.force_logindjango/test/client.py:8558 ms13.6%
ClientMixin._logindjango/test/client.py:8814 ms6.8%
logindjango/contrib/auth/__init__.py:1872 ms3.4%
SessionBase.cycle_keydjango/contrib/sessions/backends/base.py:4342 ms3.4%
SessionStore.createdjango/contrib/sessions/backends/db.py:742 ms3.4%
SessionStore.savedjango/contrib/sessions/backends/db.py:1262 ms3.4%
Atomic.__exit__django/db/transaction.py:2472 ms3.4%
async_unsafe.<locals>.decorator.<locals>.innerdjango/utils/asyncio.py:262 ms3.4%
BaseDatabaseWrapper.savepoint_commitdjango/db/backends/base/base.py:4312 ms3.4%
BaseDatabaseWrapper._savepoint_commitdjango/db/backends/base/base.py:3752 ms3.4%
CursorWrapper.executedjango/db/backends/utils.py:792 ms3.4%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:922 ms3.4%
CursorWrapper._executedjango/db/backends/utils.py:1032 ms3.4%
Cursor.executepsycopg/cursor.py:1132 ms3.4%
Connection.waitpsycopg/connection.py:4952 ms3.4%
logindjango/contrib/auth/__init__.py:1972 ms3.4%
Signal.senddjango/dispatch/dispatcher.py:2092 ms3.4%
update_last_logindjango/contrib/auth/models.py:242 ms3.4%
AbstractBaseUser.savedjango/contrib/auth/base_user.py:622 ms3.4%
Model.savedjango/db/models/base.py:8742 ms3.4%
Model.save_basedjango/db/models/base.py:9662 ms3.4%
Model._save_tabledjango/db/models/base.py:11102 ms3.4%
Model._do_updatedjango/db/models/base.py:12112 ms3.4%
QuerySet._updatedjango/db/models/query.py:13272 ms3.4%
SQLUpdateCompiler.execute_returning_sqldjango/db/models/sql/compiler.py:21402 ms3.4%
SQLUpdateCompiler.execute_sqldjango/db/models/sql/compiler.py:21112 ms3.4%
SQLCompiler.execute_sqldjango/db/models/sql/compiler.py:16242 ms3.4%
CursorWrapper.executedjango/db/backends/utils.py:792 ms3.4%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:922 ms3.4%
CursorWrapper._executedjango/db/backends/utils.py:1052 ms3.4%
Cursor.executepsycopg/cursor.py:1132 ms3.4%
Connection.waitpsycopg/connection.py:4952 ms3.4%
ClientMixin._logindjango/test/client.py:8762 ms3.4%
ClientMixin.sessiondjango/test/client.py:8122 ms3.4%
SessionStore.savedjango/contrib/sessions/backends/db.py:1212 ms3.4%
SessionStore.createdjango/contrib/sessions/backends/db.py:702 ms3.4%
SessionBase._get_new_session_keydjango/contrib/sessions/backends/base.py:1982 ms3.4%
SessionStore.existsdjango/contrib/sessions/backends/db.py:632 ms3.4%
BaseManager._get_queryset_methods.<locals>.create_method.<locals>.manager_methoddjango/db/models/manager.py:872 ms3.4%
ClientMixin._logindjango/test/client.py:8832 ms3.4%
SessionStore.savedjango/contrib/sessions/backends/db.py:1272 ms3.4%
Model.savedjango/db/models/base.py:8742 ms3.4%
Model.save_basedjango/db/models/base.py:9662 ms3.4%
Model._save_tabledjango/db/models/base.py:11102 ms3.4%
Model._do_updatedjango/db/models/base.py:12112 ms3.4%
QuerySet._updatedjango/db/models/query.py:13272 ms3.4%
SQLUpdateCompiler.execute_returning_sqldjango/db/models/sql/compiler.py:21402 ms3.4%
SQLUpdateCompiler.execute_sqldjango/db/models/sql/compiler.py:21112 ms3.4%
SQLCompiler.execute_sqldjango/db/models/sql/compiler.py:16242 ms3.4%
CursorWrapper.executedjango/db/backends/utils.py:792 ms3.4%
CursorWrapper._execute_with_wrappersdjango/db/backends/utils.py:922 ms3.4%
CursorWrapper._executedjango/db/backends/utils.py:1052 ms3.4%
Cursor.executepsycopg/cursor.py:1132 ms3.4%
Connection.waitpsycopg/connection.py:4952 ms3.4%
ProjectPagesTest.test_htmx_refreshapps/projects/tests.py:1131 response = self.client.get(self.project.url("htmx_refresh", self.ingest_run.number))6 ms10.2%
Client.getdjango/test/client.py:11246 ms10.2%
RequestFactory.getdjango/test/client.py:4756 ms10.2%
RequestFactory.genericdjango/test/client.py:6716 ms10.2%
Client.requestdjango/test/client.py:10826 ms10.2%
ClientHandler.__call__django/test/client.py:1864 ms6.8%
BaseHandler.get_responsedjango/core/handlers/base.py:1414 ms6.8%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:554 ms6.8%
DebugToolbarMiddleware.__call__debug_toolbar/middleware.py:1304 ms6.8%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:554 ms6.8%
MiddlewareMixin.__call__django/utils/deprecation.py:3094 ms6.8%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:554 ms6.8%
WhiteNoiseMiddleware.__call__whitenoise/middleware.py:1234 ms6.8%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:554 ms6.8%
MiddlewareMixin.__call__django/utils/deprecation.py:3094 ms6.8%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:554 ms6.8%
MiddlewareMixin.__call__django/utils/deprecation.py:3094 ms6.8%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:554 ms6.8%
MiddlewareMixin.__call__django/utils/deprecation.py:3094 ms6.8%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:554 ms6.8%
MiddlewareMixin.__call__django/utils/deprecation.py:3094 ms6.8%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:554 ms6.8%
MiddlewareMixin.__call__django/utils/deprecation.py:3094 ms6.8%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:554 ms6.8%
MiddlewareMixin.__call__django/utils/deprecation.py:3094 ms6.8%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:554 ms6.8%
AccountMiddleware.<locals>.middlewareallauth/account/middleware.py:344 ms6.8%
convert_exception_to_response.<locals>.innerdjango/core/handlers/exception.py:554 ms6.8%
BaseHandler._get_responsedjango/core/handlers/base.py:1984 ms6.8%
user_passes_test.<locals>.decorator.<locals>._view_wrapperdjango/contrib/auth/decorators.py:562 ms3.4%
login_required.<locals>.<lambda>django/contrib/auth/decorators.py:792 ms3.4%
new_method_proxy.<locals>.innerdjango/utils/functional.py:2512 ms3.4%
SimpleLazyObject._setupdjango/utils/functional.py:4042 ms3.4%
AuthenticationMiddleware.process_request.<locals>.<lambda>django/contrib/auth/middleware.py:402 ms3.4%
get_userdjango/contrib/auth/middleware.py:202 ms3.4%
get_userdjango/contrib/auth/__init__.py:3112 ms3.4%
_get_user_session_keydjango/contrib/auth/__init__.py:952 ms3.4%
SessionBase.__getitem__django/contrib/sessions/backends/base.py:552 ms3.4%
SessionBase._get_sessiondjango/contrib/sessions/backends/base.py:2512 ms3.4%
SessionStore.loaddjango/contrib/sessions/backends/db.py:562 ms3.4%
SessionBase.decodedjango/contrib/sessions/backends/base.py:1352 ms3.4%
loadsdjango/core/signing.py:1712 ms3.4%
Signer.unsign_objectdjango/core/signing.py:2442 ms3.4%
user_passes_test.<locals>.decorator.<locals>._view_wrapperdjango/contrib/auth/decorators.py:592 ms3.4%
htmx_refreshapps/projects/urls.py:6012 ms3.4%
managed_projectapps/projects/urls.py:61 project = get_object_or_404(2 ms3.4%
get_object_or_404django/shortcuts.py:902 ms3.4%
QuerySet.getdjango/db/models/query.py:6352 ms3.4%
ClientHandler.__call__django/test/client.py:1762 ms3.4%
Signal.senddjango/dispatch/dispatcher.py:2092 ms3.4%
reset_queriesdjango/db/__init__.py:482 ms3.4%
Estimated from 30 samples; phase durations are exact. Frames from pytest and pluggy are
hidden
.
Hot lines in your code
|
apps/projects/tests.py:1129
response = self.client.get(self.project.url("htmx_refresh"))
ProjectPagesTest.test_htmx_refresh
· Libraries
|
34 ms |
|
apps/projects/tests.py:953
self.client.force_login(self.user)
ProjectPagesTest.setUp
· Database
|
8 ms |
|
apps/projects/tests.py:1131
response = self.client.get(self.project.url("htmx_refresh", self.ingest_run.number))
ProjectPagesTest.test_htmx_refresh
· Database
|
4 ms |
|
apps/projects/urls.py:613
TestRun.objects.filter(test__project=project).exists() or Profile.objects.filter(project=project).exists()
htmx_refresh
· Database
|
2 ms |
|
apps/projects/urls.py:61
project = get_object_or_404(
managed_project
· Database
|
2 ms |
Fixtures
Exact setup time| _dj_autoclear_mailbox function | 0.07 ms |
| _django_db_marker function | 0.06 ms |
| _django_set_urlconf function | 0.05 ms |
| _template_string_if_invalid_marker function | 0.04 ms |
| _live_server_helper function | 0.04 ms |
| _django_clear_site_cache function | 0.04 ms |
| monkeypatch function | 0.02 ms |
Database
30 queries · 11 ms
Repeated queries are usually N+1 lookups: fetch them once with select_related / prefetch_related (or selectinload).
3×
SELECT "django_session"."session_key", "django_session"."session_data", "django_session"."expire_date" FROM "django_session" WHERE ("django_session"."expire_date" > %s AND "django_session"."session_key" = %s) LIMIT ?
Biggest pieces of work
|
call test body
apps/projects/tests.py:1129
|
43 ms |
|
call _post_teardown
django/test/testcases.py:1240
|
8 ms |
|
call setUp
apps/projects/tests.py:953
|
8 ms |
| setup pytest internals | 0.84 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 | |
|---|---|---|---|---|
| 45 minutes ago | CI github-actions:test | passed | 60 ms | Profile |
| an hour ago | CI github-actions:test | passed | 60 ms | Profile |
| 7 hours ago | CI github-actions:test | passed | 59 ms | Profile |
| 8 hours ago | CI github-actions:test | passed | 30 ms | Profile |
| 8 hours ago | CI github-actions:test | passed | 59 ms | Profile |