inlet/flow: be more lenient on the test about sampling rate

This commit is contained in:
Vincent Bernat
2022-08-28 00:11:04 +02:00
parent a2c1a848b9
commit 41744ff7ad

View File

@@ -103,7 +103,7 @@ func TestFlow(t *testing.T) {
// upper limit of the sampling rate. However,
// the lower limit should be OK.
expectedRate := uint64(30000 / 1000 * nominalRate)
if flow.SamplingRate > 1000*expectedRate/100 || flow.SamplingRate < 90*expectedRate/100 {
if flow.SamplingRate > 1000*expectedRate/100 || flow.SamplingRate < 70*expectedRate/100 {
t.Fatalf("Sampling rate is %d, expected %d", flow.SamplingRate, expectedRate)
}
case <-time.After(30 * time.Millisecond):