-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
131020: requestbatcher: reduce timing-sensitivity in test r=tbg a=tbg A number of the requestbatcher tests are sadly timing-sensitive. They set the max wait times for the batcher to carefully crafted values, but are also sensitive to go scheduling latencies that can play into how much time elapses between the batcher getting handed the various requests. Given how flaky they _should_ be, they are remarkably stable, but a simple `time.Sleep` in the right place deterministically causes issues. This commit deflakes a specific test - `TestBatcherSend` - and does so by making time and timers completely mockable in the batcher through injection of a `ManualTime`. It also introduces a simple mechanism that allows tests to peek inside of the batcher by momentarily stopping its worker goroutine. I stopped short of updating the other tests entirely - that would likely take me more time than I'm willing to additionally spend here - but I left comments that should be actionable should any of these tests ever cause issues. Fixes #130969. Epic: none Release note: None Co-authored-by: Tobias Grieger <[email protected]>
- Loading branch information
Showing
4 changed files
with
130 additions
and
26 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
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