Skip to content

[prober] Fix flaky TestStartProbesWithJitter - #1524

Merged
manugarg merged 1 commit into
mainfrom
prober-jitter-test-tolerance
Oct 4, 2026
Merged

manugarg merged 1 commit into
mainfrom
prober-jitter-test-tolerance

Conversation

@manugarg

@manugarg manugarg commented Oct 4, 2026

Copy link
Copy Markdown
Contributor

`TestStartProbesWithJitter` failed in CI (ubuntu, on #1517) with:

prober_test.go:199:
    Error: "999.954947ms" is not greater than or equal to "1s"

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.

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.
@manugarg
manugarg merged commit 8878ea4 into main Oct 4, 2026
13 checks passed
@manugarg
manugarg deleted the prober-jitter-test-tolerance branch October 4, 2026 22:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant