Skip to content

Commit 0c6e3aa

Browse files
authored
Suppress the hang (#18457)
1 parent d0ca9bd commit 0c6e3aa

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

Lib/test/test_asyncio/test_subprocess.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -477,12 +477,19 @@ def kill():
477477
proc.kill = kill
478478
returncode = transport.get_returncode()
479479
transport.close()
480-
await transport._wait()
480+
await asyncio.wait_for(transport._wait(), 5)
481481
return (returncode, kill_called)
482482

483483
# Ignore "Close running child process: kill ..." log
484484
with test_utils.disable_logger():
485-
returncode, killed = self.loop.run_until_complete(kill_running())
485+
try:
486+
returncode, killed = self.loop.run_until_complete(
487+
kill_running()
488+
)
489+
except asyncio.TimeoutError:
490+
self.skipTest(
491+
"Timeout failure on waiting for subprocess stopping"
492+
)
486493
self.assertIsNone(returncode)
487494

488495
# transport.close() must kill the process if it is still running

0 commit comments

Comments
 (0)