From 013da0216bc326d002c759fc77c394de7748b65a Mon Sep 17 00:00:00 2001 From: Yahor Yuzefovich Date: Mon, 26 Oct 2020 17:07:10 -0700 Subject: [PATCH] logictest: deflake a test We've recently merged a test that in very rare circumstances could produce a float result that differs from the expected one by 1 in the 15th significant digit (after rounding). I believe that could occur, e.g. when the 15th and 16th significant digits were `35`, and we matched the spec of supporting 15 significant digits for floats, yet the rounding makes us return an unexpected result. This commit rounds to the precision of 1 digit less which should make the test non-flaky. Release note: None --- pkg/sql/logictest/testdata/logic_test/aggregate | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/sql/logictest/testdata/logic_test/aggregate b/pkg/sql/logictest/testdata/logic_test/aggregate index ac9bd7627ee0..01d2944de7b9 100644 --- a/pkg/sql/logictest/testdata/logic_test/aggregate +++ b/pkg/sql/logictest/testdata/logic_test/aggregate @@ -858,10 +858,10 @@ VALUES (1, 1.1, 1.1), (18, 11.2, 11.2); query FRF -select sqrdiff(i), round(sqrdiff(f), 13), sqrdiff(d) +select sqrdiff(i), round(sqrdiff(f), 12), sqrdiff(d) from ifd ---- -206.8333333333333333333334 86.2483333333333 86.24833333333333333333333 +206.8333333333333333333334 86.248333333333 86.24833333333333333333333 query FRF SELECT sqrdiff(i), round(sqrdiff(f), 2), sqrdiff(d)