From 2519e4794717a514d6b8da8708be58f0598bff68 Mon Sep 17 00:00:00 2001 From: gempir Date: Fri, 27 Sep 2024 21:38:50 +0200 Subject: [PATCH] add variable for tolerance and increase it to 5ms --- client_test.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/client_test.go b/client_test.go index 9e9e264..3d24385 100644 --- a/client_test.go +++ b/client_test.go @@ -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) @@ -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) }