-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from jameinel/clock-stacks
#3 1) Actually wire up the tests for the testing clock. In moving them out of 'util' we missed having the TestAll function. 2) Fix a test that checked the logs, but didn't tell the logging infrastructure that it needed to read all Debug level log messages. 3) Change clock.WaitAdvance to not break the time into 10 even slices. This is because *many* tests use WaitAdvance(..., LongWait), which means that if they aren't ready immediately, then they way 1s before checking again, which is way too long. Instead we cap out at 10ms, so we don't spin waiting for the right number of waiters, but we also don't wait too long. We still stop at the same time, and we still stop as soon as we have the expected number of waiters. 4) Track the stack traces of who is waiting for the clock. This makes it possible to know *who* has actually called clock.After() and co, so you can figure out why there are a particular number of Waiters, and whether that is the correct number or not. Nothing about the interface to the testing clock changes with this, it is just hopefully slightly nicer to debug issues when using the testing clock.
- Loading branch information
Showing
2 changed files
with
45 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters