Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve testTasksScheduledDuringShutdownAreAutomaticallyCancelled
Motivation: NIOAsyncTestingEventLoopTests.testTasksScheduledDuringShutdownAreAutomaticallyCancelled is flaky. The recursivesly schedules tasks to run on the event loop and then, after a small pause, shuts down the event loop. It then asserts that more then 1 task was scheduled (i.e. at least 1 recursive task was run). This assertion occasionally fails as exactly 1 task was run. I haven't been able to reproduce this locally but I believe the root of the flakiness is that the child tasks to shutdown the loop and advance the time (to trigger the recursive scheduling) can race. If the shutdown wins then only the root task will run. Modifications: - Remove the array of scheduled tasks, it wasn't being used - Fix atomic ordering - Increase sleep time before shutting down - Advance time in the task group rather than a child task Result: Less flaky test (hopefully)
- Loading branch information