Repository navigation
[prober] Fix flaky TestStartProbesWithJitter - #1524
Merged
Merged
Conversation
The prober sleeps 1s between starting the two probes, but each probe records its start time in its own goroutine, so the measured gap can come out a little under 1s (999.95ms in CI). Assert on 900ms instead.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
`TestStartProbesWithJitter` failed in CI (ubuntu, on #1517) with:
The prober sleeps exactly 1s between starting the two probes (2s default interval, 2 probes), but each probe records its start time in its own goroutine. If the second probe's goroutine gets going a little quicker than the first one's did, the measured gap comes out just under 1s. The jitter code is fine; the assertion was too exact.
This asserts on 900ms instead. Test-only change; the windows exemption stays as it is.
Tested with `go test ./prober -run TestStartProbesWithJitter -count=30 -race`: all pass. I did not reproduce the original failure locally, so the diagnosis is from the CI log and the code.