Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork32k
GH-100192: add moreasyncio
subprocess tests#100194
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Why notawait task
instead ofsleep(0)
andtask.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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
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 usingsleep(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 commentedDec 28, 2022
|
kumaraditya303 commentedDec 28, 2022 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
bedevere-bot commentedDec 28, 2022
|
bedevere-bot commentedDec 28, 2022
|
Uh oh!
There was an error while loading.Please reload this page.
asyncio
subprocess #100192