Control async timeout when unit testing and using interactive debugging #2019
Unanswered
johnthagen
asked this question in
Q&A
Replies: 1 comment
-
A one off workaround for some use cases is to temporarily change the unit test line to something like: response = await communicator.receive_json_from(timeout=100) Though this doesn't scale super well and is prone to forgetting to removing the
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
When developing unit tests I find it often very valuable to step through the unit test and the code it calls in a visual debugger.
I am writing
async
tests usingWebsocketCommunicator
against anAsyncJsonWebsocketConsumer
. If I put a break point within the consumer, the execution will pause as expected, but whenever I start running it again, I get aTimeoutError
:This makes it very tedious to debug and step through various parts of the code.
How do users handle debugging
async
tests? I've also seen other similar issues when stepping in@database_sync_to_async
functions. It seems like having a global timeout configuration or for the timeout not to be applied when debugging would be nice?Curious how other users have handled this.
Beta Was this translation helpful? Give feedback.
All reactions