From 91db7c57a37f7d8845c1099ce6f3c81feeecfcb4 Mon Sep 17 00:00:00 2001 From: marco Date: Wed, 10 Jul 2024 11:58:32 +0200 Subject: [PATCH 1/2] tests: increase delta for flaky float comparison --- pkg/exprhelpers/exprlib_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/exprhelpers/exprlib_test.go b/pkg/exprhelpers/exprlib_test.go index 33025d4a992..47dac1efff1 100644 --- a/pkg/exprhelpers/exprlib_test.go +++ b/pkg/exprhelpers/exprlib_test.go @@ -1361,7 +1361,7 @@ func TestGetActiveDecisionsTimeLeft(t *testing.T) { }, } - delta := 0.0001 + delta := 0.001 for _, test := range tests { program, err := expr.Compile(test.code, GetExprOptions(test.env)...) From 1204736cd97658dcbd0b47afae6ea7da942454fc Mon Sep 17 00:00:00 2001 From: marco Date: Mon, 15 Jul 2024 10:23:30 +0200 Subject: [PATCH 2/2] remove leading 0 from non-octal number --- pkg/exprhelpers/exprlib_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/exprhelpers/exprlib_test.go b/pkg/exprhelpers/exprlib_test.go index 47dac1efff1..b9ba1d01191 100644 --- a/pkg/exprhelpers/exprlib_test.go +++ b/pkg/exprhelpers/exprlib_test.go @@ -1392,12 +1392,12 @@ func TestParseUnixTime(t *testing.T) { { name: "ParseUnix() test: valid value with milli", value: "1672239773.3590894", - expected: time.Date(2022, 12, 28, 15, 02, 53, 0, time.UTC), + expected: time.Date(2022, 12, 28, 15, 2, 53, 0, time.UTC), }, { name: "ParseUnix() test: valid value without milli", value: "1672239773", - expected: time.Date(2022, 12, 28, 15, 02, 53, 0, time.UTC), + expected: time.Date(2022, 12, 28, 15, 2, 53, 0, time.UTC), }, { name: "ParseUnix() test: invalid input",