Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
channels: Don't rely on tight timing constraints (JuliaLang#49090)
The test was relying on two particular non-guaranteed timing races: 1. That the 0.5s wait task was started within 0.5s of the timedwait starting. 2. That the timedwait finished within 0.5 seconds of its deadline. Neither of these are guaranteed. The second of these was already made non-fatal with a warning print. However, I don't like warning prints in tests. They should either pass or fail. Nobody looks at the output unless the tests fail, so change the tests to: 1. Add extra synchronization to solve the race condition (1) by making sure the sleep starts before the timedwait. 2. Instead of doing a long wait, just have a synchronization channel that will never be made active. In particular, the thing that this test checks is that the timeout in `timedwait` actually works, and doesn't return too early. This arrangement checks both of those properties without unduly tight timing constraints.
- Loading branch information