Skip to content

Commit

Permalink
bench/rttanalysis: allow roundtrips to be off by 1
Browse files Browse the repository at this point in the history
If we don't have a range, let the currently estimate be wrong by 1.
We mostly care about the ballpark and the growth rate. I'm sick of
these flakes.

Fixes #73884.

Release note: None
  • Loading branch information
ajwerner committed Dec 21, 2021
1 parent 1903b8f commit 0750472
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pkg/bench/rttanalysis/validate_benchmark_data.go
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,10 @@ func (b benchmarkExpectations) find(name string) (benchmarkExpectation, bool) {
}

func (e benchmarkExpectation) matches(roundTrips int) bool {
return e.min <= roundTrips && roundTrips <= e.max
// Either the value falls within the expected range, or
return (e.min <= roundTrips && roundTrips <= e.max) ||
// the expectation isn't a range, so give it a leeway of one.
e.min == e.max && (roundTrips == e.min-1 || roundTrips == e.min+1)
}

func (e benchmarkExpectation) String() string {
Expand Down

0 comments on commit 0750472

Please sign in to comment.