app/vmselect/promql: reduce the precision from 15 significant digits to 13 significant digits when comparing float64 results in tests

See https://github.com/VictoriaMetrics/VictoriaMetrics/issues/1738
This commit is contained in:
Aliaksandr Valialkin 2021-10-24 13:31:12 +03:00
parent 8d0fafc377
commit df8f967040
No known key found for this signature in database
GPG key ID: A72BEC6CD3D0DED1

View file

@ -1167,7 +1167,9 @@ func testRowsEqual(t *testing.T, values []float64, timestamps []int64, valuesExp
}
continue
}
if math.Abs(v-vExpected) > 1e-15 {
// Compare values with the reduced precision because of different precision errors
// on different OS/architectures. See https://github.com/VictoriaMetrics/VictoriaMetrics/issues/1738
if math.Abs(v-vExpected) > 1e-13 {
t.Fatalf("unexpected value at values[%d]; got %f; want %f\nvalues=\n%v\nvaluesExpected=\n%v",
i, v, vExpected, values, valuesExpected)
}