Skip to content

Commit

Permalink
Fix test_signalctl_wait_for_09 (#6835)
Browse files Browse the repository at this point in the history
Under Python 3.12+ `stdin.readline()` is returning `EOF` after the process
is terminated; let's replace it with a infinite future.

Co-authored-by: Fantix King <[email protected]>
  • Loading branch information
elprans and fantix authored Feb 13, 2024
1 parent 619f13f commit a65ad3c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/common/test_signalctl.py
Original file line number Diff line number Diff line change
Expand Up @@ -311,17 +311,17 @@ async def _task():
try:
await self.wait_for_parent(2) # cancelled by signal
except asyncio.CancelledError:
# In case the task cancellation is hanging, ..
# In case the task cancellation is hanging, we should still
# be able to reliably cancel the task, see timeout below
fut.set_result(None)
await self.wait_for_parent(2)
await self.loop.create_future()
with signalctl.SignalController(signal.SIGTERM) as sc:
task = self.loop.create_task(
sc.wait_for(_task(), cancel_on={signal.SIGTERM})
)
await fut
# .. we should still be able to reliably cancel the task
with self.assertRaises(asyncio.TimeoutError):
await asyncio.wait_for(task, 0.2)
self.assertTrue(task.done())
Expand Down

0 comments on commit a65ad3c

Please sign in to comment.