Uh oh!
There was an error while loading. Please reload this page.
GH-100192: add more asyncio subprocess tests - #100194
Conversation
Uh oh!
There was an error while loading. Please reload this page.
| task = asyncio.create_task(proc.wait()) | ||
| await asyncio.sleep(0) | ||
| self.assertEqual(task.result(), proc.returncode) |
There was a problem hiding this comment.
Why not await task instead of sleep(0) and task.result()? At this point we already know the process has exited, since the returncode is 0 on the previous line.
There was a problem hiding this comment.
At this point we already know the process has exited, since the returncode is 0 on the previous line.
Yes, awaiting can take more than one cycle but we are checking that wait will be done immediately so using sleep(0) trick.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
bedevere-bot
commented
Dec 28, 2022
|
bedevere-bot
commented
Dec 28, 2022
|
bedevere-bot
commented
Dec 28, 2022
|
asynciosubprocess #100192