| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
…deterministic The test cancelled the parent task from outside after a 10 ms sleep, expecting the group to still be waiting for its child. If the event loop stalled for longer than that before the body task first ran, the outer cancel() landed while the parent's awaited future was already cancelled by the group, and its message was dropped, failing the test on slow builds such as the TSan CI job. Synchronize on events instead: the child signals from its finally block that the group is cancelling and waits to be released, and only then is the parent task cancelled from outside.
|
I have made the requested changes; please review again |
Sorry, something went wrong.
|
Thanks for making the requested changes! : please review the changes made to this pull request. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Fixes the timing dependence described in the issue: the test cancelled the parent task from outside after await asyncio.sleep(0.01), and lost the cancellation message whenever the loop stalled for more than 10 ms before the body task first ran (the mechanism, and a reproducer that stalls the loop with time.sleep(), are in the issue).
The test now synchronizes on two events instead of sleeping. The child signals from its finally block that the group is cancelling, which by then has cancelled the parent task and is waiting for the child, and waits there until the test releases it. Only then does the test cancel the parent task from outside. The ordering is fixed by the callback queue, not by time, so it holds on any build speed and for both task implementations.
Checked:
Since the original test was added by the gh-155433 fix, this likely wants the same backports.