Skip to content

Commit

Permalink
Suppress the hang (#18457)
Browse files Browse the repository at this point in the history
  • Loading branch information
asvetlov committed Feb 26, 2020
1 parent d0ca9bd commit 0c6e3aa
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions Lib/test/test_asyncio/test_subprocess.py
Expand Up @@ -477,12 +477,19 @@ def kill():
proc.kill = kill
returncode = transport.get_returncode()
transport.close()
await transport._wait()
await asyncio.wait_for(transport._wait(), 5)
return (returncode, kill_called)

# Ignore "Close running child process: kill ..." log
with test_utils.disable_logger():
returncode, killed = self.loop.run_until_complete(kill_running())
try:
returncode, killed = self.loop.run_until_complete(
kill_running()
)
except asyncio.TimeoutError:
self.skipTest(
"Timeout failure on waiting for subprocess stopping"
)
self.assertIsNone(returncode)

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

0 comments on commit 0c6e3aa

Please sign in to comment.