]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Revert "A better fix for asyncio test_stdin_broken_pipe (GH-7221)" (GH-7235)
authorYury Selivanov <yury@magic.io>
Wed, 30 May 2018 02:00:31 +0000 (22:00 -0400)
committerGitHub <noreply@github.com>
Wed, 30 May 2018 02:00:31 +0000 (22:00 -0400)
This reverts commit ad74d50517c069359578014bb32e660828d68332.

Turns out it's not a good fix -- Travis has just crashed on this test.

Lib/test/test_asyncio/test_subprocess.py

index 01583376e5716bc641625ea89d9ed2e1f0d7266b..235813aa977c1e625cad5a3ba5e9a393e529a952 100644 (file)
@@ -218,10 +218,8 @@ class SubprocessMixin:
 
         # the program ends before the stdin can be feeded
         create = asyncio.create_subprocess_exec(
-                             sys.executable,
-                             '-c', 'print("hello", flush=True)',
+                             sys.executable, '-c', 'pass',
                              stdin=subprocess.PIPE,
-                             stdout=subprocess.PIPE,
                              loop=self.loop)
         proc = self.loop.run_until_complete(create)
         return (proc, large_data)
@@ -230,7 +228,7 @@ class SubprocessMixin:
         proc, large_data = self.prepare_broken_pipe_test()
 
         async def write_stdin(proc, data):
-            await proc.stdout.readline()
+            await asyncio.sleep(0.5, loop=self.loop)
             proc.stdin.write(data)
             await proc.stdin.drain()