mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2025-02-09 15:27:11 +00:00
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:
parent
8d0fafc377
commit
df8f967040
1 changed files with 3 additions and 1 deletions
|
@ -1167,7 +1167,9 @@ func testRowsEqual(t *testing.T, values []float64, timestamps []int64, valuesExp
|
||||||
}
|
}
|
||||||
continue
|
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",
|
t.Fatalf("unexpected value at values[%d]; got %f; want %f\nvalues=\n%v\nvaluesExpected=\n%v",
|
||||||
i, v, vExpected, values, valuesExpected)
|
i, v, vExpected, values, valuesExpected)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue