Skip to content

Commit de602a5

Browse files
committed
fix: explicit yield after run_in_executor as it was implicitly needed
1 parent 1640d6e commit de602a5

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

tests/test_context.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -474,6 +474,11 @@ def close():
474474
# send data
475475
await self.loop.run_in_executor(None,
476476
ssl_sock.send, b'hello')
477+
# After gh-105836 run_in_executor may resolve without
478+
# yielding. This is very noticeable when PYTHONASYNCIODEBUG
479+
# is set. Hence, we yield explicitly so that the sent data
480+
# can reach the SSL buffer before close/resume_reading.
481+
await asyncio.sleep(0)
477482
# schedule a proactive transport close which will trigger
478483
# the flushing process to retrieve the remaining data
479484
self.loop.call_soon(close)

0 commit comments

Comments
 (0)