-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add async tests #1835
Add async tests #1835
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for the late reply on this. Thank you for creating this PR!
I wonder if we could test this functionality by starting up runserver
with the asgi application, then using a separate selenium test against that rather than using the Django test runner.
Closing in favor of #1938. Thank you for pushing this forward @salomvary! Your work here was helpful to the GSoC project to push the toolbar forward with async compatibility. |
Nope, I was wrong. This still has value. |
Rebased on main |
for more information, see https://pre-commit.ci
@salomvary could you confirm that the deadlock issue is not a problem in this version? @salty-ivy removed the sql panel from async installations which seems to have resolved that issue. Granted, now the issue is that the toolbar doesn't have a SQL panel for async apps, but at least it doesn't lock up. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @salomvary for this! I'd still like your confirmation the deadlock has been handled when/if you have time.
I think it was more of a django ORM issue rather than the toolbar itself. @salomvary mentioned it here |
Weird, on my machine it was executing them concurrently (I think). Or at least they didn't result in a deadlock. |
Yep, the deadlock was very likely not cause by the Debug Toolbar, it is a Django issue. As far as I can remember I was later able to reproduce the deadlock with Debug Toolbar not even installed. |
As discussed with @tim-schilling in #1828 a good start towards adding async support is adding tests involving async views and async ORM usage.
Unfortunately, none of the automated tests showcase the problem described in #1828 as there is no ASGI equivalent of
LiveServerTestCase
and the issue seems to be specific to running an actual ASGI server.Therefore, despite all tests are green, async support is still not there. Running the example app with an ASGI server using
ASYNC_SERVER=true python example/manage.py runserver
and visiting http://127.0.0.1:8000/async/db-concurrent/ does exhibit the deadlock though.See also #1819.