summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Svetlov <andrew.svetlov@gmail.com>2020-02-26 22:15:12 (GMT)
committerGitHub <noreply@github.com>2020-02-26 22:15:12 (GMT)
commit0c6e3aa67b84adb0fb7c272ae06b7ae77f832295 (patch)
tree087bca26a1aa15a2cd40f011b28bf8b8db447228
parentd0ca9bd93bb9d8d4aa9bbe939ca7fd54ac870c8f (diff)
downloadcpython-0c6e3aa67b84adb0fb7c272ae06b7ae77f832295.zip
cpython-0c6e3aa67b84adb0fb7c272ae06b7ae77f832295.tar.gz
cpython-0c6e3aa67b84adb0fb7c272ae06b7ae77f832295.tar.bz2
Suppress the hang (#18457)
-rw-r--r--Lib/test/test_asyncio/test_subprocess.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/Lib/test/test_asyncio/test_subprocess.py b/Lib/test/test_asyncio/test_subprocess.py
index a6c3acc..6657a88 100644
--- a/Lib/test/test_asyncio/test_subprocess.py
+++ b/Lib/test/test_asyncio/test_subprocess.py
@@ -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