@@ -218,8 +218,10 @@ def prepare_broken_pipe_test(self):
|
218 | 218 | |
219 | 219 | # the program ends before the stdin can be feeded |
220 | 220 | create = asyncio.create_subprocess_exec( |
221 | | -sys.executable, '-c', 'pass', |
| 221 | +sys.executable, |
| 222 | +'-c', 'print("hello", flush=True)', |
222 | 223 | stdin=subprocess.PIPE, |
| 224 | +stdout=subprocess.PIPE, |
223 | 225 | loop=self.loop) |
224 | 226 | proc = self.loop.run_until_complete(create) |
225 | 227 | return (proc, large_data) |
@@ -228,7 +230,7 @@ def test_stdin_broken_pipe(self):
|
228 | 230 | proc, large_data = self.prepare_broken_pipe_test() |
229 | 231 | |
230 | 232 | async def write_stdin(proc, data): |
231 | | -await asyncio.sleep(0.5, loop=self.loop) |
| 233 | +await proc.stdout.readline() |
232 | 234 | proc.stdin.write(data) |
233 | 235 | await proc.stdin.drain() |
234 | 236 | |
|