[Python-checkins] Revert "A better fix for asyncio test_stdin_broken_pipe (GH-7221)" (GH-7235)

Yury Selivanov webhook-mailer at python.org
Tue May 29 22:00:37 EDT 2018


https://github.com/python/cpython/commit/bb9474f1fb2fc7c7ed9f826b78262d6a12b5f9e8
commit: bb9474f1fb2fc7c7ed9f826b78262d6a12b5f9e8
branch: master
author: Yury Selivanov <yury at magic.io>
committer: GitHub <noreply at github.com>
date: 2018-05-29T22:00:31-04:00
summary:

Revert "A better fix for asyncio test_stdin_broken_pipe (GH-7221)" (GH-7235)

This reverts commit ad74d50517c069359578014bb32e660828d68332.

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

files:
M Lib/test/test_asyncio/test_subprocess.py

diff --git a/Lib/test/test_asyncio/test_subprocess.py b/Lib/test/test_asyncio/test_subprocess.py
index 01583376e571..235813aa977c 100644
--- a/Lib/test/test_asyncio/test_subprocess.py
+++ b/Lib/test/test_asyncio/test_subprocess.py
@@ -218,10 +218,8 @@ def prepare_broken_pipe_test(self):
 
         # 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 @@ def test_stdin_broken_pipe(self):
         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()
 



More information about the Python-checkins mailing list