Suppress the hang (#18457)

This commit is contained in:
Andrew Svetlov 2020-02-27 00:15:12 +02:00 committed by GitHub
parent d0ca9bd93b
commit 0c6e3aa67b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 2 deletions

View File

@ -477,12 +477,19 @@ class SubprocessMixin:
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