From 9d933bb213e8bb2f77a572669a5d57393ec5e761 Mon Sep 17 00:00:00 2001 From: samypr100 <3933065+samypr100@users.noreply.github.com> Date: Fri, 3 Apr 2026 21:32:24 -0400 Subject: [PATCH] fix: explicit yield after run_in_executor as it was implicitly needed --- tests/test_context.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/test_context.py b/tests/test_context.py index 2b2329f9..1ea360c7 100644 --- a/tests/test_context.py +++ b/tests/test_context.py @@ -474,6 +474,11 @@ def close(): # send data await self.loop.run_in_executor(None, ssl_sock.send, b'hello') + # After gh-105836 run_in_executor may resolve without + # yielding. This is very noticeable when PYTHONASYNCIODEBUG + # is set. Hence, we yield explicitly so that the sent data + # can reach the SSL buffer before close/resume_reading. + await asyncio.sleep(0) # schedule a proactive transport close which will trigger # the flushing process to retrieve the remaining data self.loop.call_soon(close)