Skip to content

Commit

Permalink
[3.2.x] Fixed test_request_lifecycle_signals_dispatched_with_thread_s…
Browse files Browse the repository at this point in the history
…ensitive with asgiref 3.5.1+.
  • Loading branch information
felixxm committed Jun 22, 2022
1 parent 2dc85ec commit 7595f76
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions tests/asgi/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,11 +235,8 @@ def __call__(self, **kwargs):
# Give response.close() time to finish.
await communicator.wait()

# At this point, AsyncToSync does not have a current executor. Thus
# SyncToAsync falls-back to .single_thread_executor.
target_thread = next(iter(SyncToAsync.single_thread_executor._threads))
# AsyncToSync should have executed the signals in the same thread.
request_started_thread, request_finished_thread = signal_handler.threads
self.assertEqual(request_started_thread, target_thread)
self.assertEqual(request_finished_thread, target_thread)
self.assertEqual(request_started_thread, request_finished_thread)
request_started.disconnect(signal_handler)
request_finished.disconnect(signal_handler)

0 comments on commit 7595f76

Please sign in to comment.