Skip to content

Commit

Permalink
add variable for tolerance and increase it to 5ms
Browse files Browse the repository at this point in the history
  • Loading branch information
gempir committed Sep 27, 2024
1 parent f2c7e57 commit 2519e47
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1878,6 +1878,7 @@ func TestLatency(t *testing.T) {
t.Parallel()
const idlePingInterval = 10 * time.Millisecond
const expectedLatency = 50 * time.Millisecond
const toleranceLatency = 5 * time.Millisecond

wait := make(chan bool)

Expand Down Expand Up @@ -1926,7 +1927,7 @@ func TestLatency(t *testing.T) {
return diff
}()

if latencyDiff > time.Millisecond*3 {
if latencyDiff > toleranceLatency {
t.Fatalf("Latency %s should be within 3ms of %s", returnedLatency, expectedLatency)
}

Expand Down

0 comments on commit 2519e47

Please sign in to comment.