From 3f6489444f1b739fdf3df2d6bc172cc22bb73187 Mon Sep 17 00:00:00 2001 From: Alex Szczuczko Date: Fri, 5 Jun 2020 09:54:50 -0600 Subject: [PATCH] Make equality fuzzy in TestGetWithin (#631) This should prevent a sporadic test failure when the time.Now() value in the test initialization doesn't match with the time.Now() inside the getWithin function. Fixes #631 --- utils_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils_test.go b/utils_test.go index 5f957123..05861b2c 100644 --- a/utils_test.go +++ b/utils_test.go @@ -457,7 +457,7 @@ func TestGetWithin(t *testing.T) { }, } for _, x := range cs { - assert.Equal(t, x.Expected, getWithin(x.Expires, x.Percent)) + assert.InDelta(t, x.Expected, getWithin(x.Expires, x.Percent), 1000000001) } }