app/vmselect/graphite: fixes tests for arm (#4348)

at arm based CPUs only 9 digits after comma matches for tests.
Especially at holtWinters functions. Since it only takes effect at tests
it makes no sense for changing float prescision at actual functions

(cherry picked from commit 228ea03bda)
This commit is contained in:
Nikolay 2023-05-26 09:34:15 +02:00 committed by hagen1778
parent ec97b851bb
commit e3ce736ce2
No known key found for this signature in database
GPG Key ID: 3BF75F3741CA9640

View File

@ -3980,6 +3980,7 @@ func compareSeries(ss, ssExpected []*series, expr graphiteql.Expr) error {
if !reflect.DeepEqual(s.Timestamps, sExpected.Timestamps) {
return fmt.Errorf("unexpected timestamps for series %q\ngot\n%d\nwant\n%d", s.Name, s.Timestamps, sExpected.Timestamps)
}
if !equalFloats(s.Values, sExpected.Values) {
return fmt.Errorf("unexpected values for series %q\ngot\n%g\nwant\n%g", s.Name, s.Values, sExpected.Values)
}
@ -4012,7 +4013,7 @@ func equalFloats(a, b []float64) bool {
} else if math.IsNaN(v2) {
return false
}
eps := math.Abs(v1) / 1e15
eps := math.Abs(v1) / 1e9
if math.Abs(v1-v2) > eps {
return false
}