]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Suppress the hang (#18457)
authorAndrew Svetlov <andrew.svetlov@gmail.com>
Wed, 26 Feb 2020 22:15:12 +0000 (00:15 +0200)
committerGitHub <noreply@github.com>
Wed, 26 Feb 2020 22:15:12 +0000 (00:15 +0200)
Lib/test/test_asyncio/test_subprocess.py

index a6c3acc420ac7d1ce06a6a7eda25aec6dc26e84a..6657a88e657c256133bb75cf70baafd4fa426c9a 100644 (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