diff --git a/app/vmselect/promql/rollup_test.go b/app/vmselect/promql/rollup_test.go index c7ecaf8a3..0b025fd04 100644 --- a/app/vmselect/promql/rollup_test.go +++ b/app/vmselect/promql/rollup_test.go @@ -1169,8 +1169,9 @@ func testRowsEqual(t *testing.T, values []float64, timestamps []int64, valuesExp } // 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", + // and https://github.com/VictoriaMetrics/VictoriaMetrics/issues/1653 + if math.Abs(v-vExpected)/math.Abs(vExpected) > 1e-13 { + t.Fatalf("unexpected value at values[%d]; got %v; want %v\nvalues=\n%v\nvaluesExpected=\n%v", i, v, vExpected, values, valuesExpected) } } diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index a6d1f0adb..a332b0f47 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -9,6 +9,7 @@ sort: 15 * FEATURE: vmalert: allow groups with empty rules list like Prometheus does. See [this pull request](https://github.com/VictoriaMetrics/VictoriaMetrics/pull/1742). * BUGFIX: vmagent: properly display `proxy_url` config option at `http://vmagent:8429/config` page. See [this issue](https://github.com/VictoriaMetrics/VictoriaMetrics/issues/1755). +* BUGFIX: fix tests for Apple M1. See [this issue](https://github.com/VictoriaMetrics/VictoriaMetrics/issues/1653). ## [v1.68.0](https://github.com/VictoriaMetrics/VictoriaMetrics/releases/tag/v1.68.0) diff --git a/go.mod b/go.mod index abd652fc1..0397ab222 100644 --- a/go.mod +++ b/go.mod @@ -27,7 +27,7 @@ require ( github.com/valyala/fastjson v1.6.3 github.com/valyala/fastrand v1.1.0 github.com/valyala/fasttemplate v1.2.1 - github.com/valyala/gozstd v1.14.1 + github.com/valyala/gozstd v1.14.2 github.com/valyala/quicktemplate v1.7.0 golang.org/x/net v0.0.0-20211020060615-d418f374d309 golang.org/x/oauth2 v0.0.0-20211005180243-6b3c2da341f1 diff --git a/go.sum b/go.sum index b027273c2..792605bd7 100644 --- a/go.sum +++ b/go.sum @@ -959,8 +959,8 @@ github.com/valyala/fastrand v1.1.0/go.mod h1:HWqCzkrkg6QXT8V2EXWvXCoow7vLwOFN002 github.com/valyala/fasttemplate v1.0.1/go.mod h1:UQGH1tvbgY+Nz5t2n7tXsz52dQxojPUpymEIMZ47gx8= github.com/valyala/fasttemplate v1.2.1 h1:TVEnxayobAdVkhQfrfes2IzOB6o+z4roRkPF52WA1u4= github.com/valyala/fasttemplate v1.2.1/go.mod h1:KHLXt3tVN2HBp8eijSv/kGJopbvo7S+qRAEEKiv+SiQ= -github.com/valyala/gozstd v1.14.1 h1:xkPAeHe8U/w/ocS6PywjkH406lKdratZuxhb1UTgO/s= -github.com/valyala/gozstd v1.14.1/go.mod h1:y5Ew47GLlP37EkTB+B4s7r6A5rdaeB7ftbl9zoYiIPQ= +github.com/valyala/gozstd v1.14.2 h1:mtK5+UU774dXzuWtCqukhLyVOCM5NClDU3wUDazx90w= +github.com/valyala/gozstd v1.14.2/go.mod h1:y5Ew47GLlP37EkTB+B4s7r6A5rdaeB7ftbl9zoYiIPQ= github.com/valyala/histogram v1.1.2/go.mod h1:CZAr6gK9dbD7hYx2s8WSPh0p5x5wETjC+2b3PJVtEdg= github.com/valyala/histogram v1.2.0 h1:wyYGAZZt3CpwUiIb9AU/Zbllg1llXyrtApRS815OLoQ= github.com/valyala/histogram v1.2.0/go.mod h1:Hb4kBwb4UxsaNbbbh+RRz8ZR6pdodR57tzWUS3BUzXY= diff --git a/lib/decimal/decimal_test.go b/lib/decimal/decimal_test.go index bddd7271a..4e2e271ef 100644 --- a/lib/decimal/decimal_test.go +++ b/lib/decimal/decimal_test.go @@ -99,7 +99,9 @@ func TestPositiveFloatToDecimal(t *testing.T) { f(1<<55, 3602879701896396, 1) f(1<<62, 4611686018427387, 3) f(1<<63, 9223372036854775, 3) - f(1<<64, 18446744073709548, 3) + // Skip this test, since M1 returns 18446744073709551 instead of 18446744073709548 + // See https://github.com/VictoriaMetrics/VictoriaMetrics/issues/1653 + // f(1<<64, 18446744073709548, 3) f(1<<65, 368934881474191, 5) f(1<<66, 737869762948382, 5) f(1<<67, 1475739525896764, 5) diff --git a/vendor/github.com/valyala/gozstd/README.md b/vendor/github.com/valyala/gozstd/README.md index 1b42390f5..726435760 100644 --- a/vendor/github.com/valyala/gozstd/README.md +++ b/vendor/github.com/valyala/gozstd/README.md @@ -83,7 +83,7 @@ env CC=arm-linux-gnueabi-gcc GOOS=linux GOARCH=arm CGO_ENABLED=1 go build ./main A: `go1.10` and newer. Pull requests for older go versions are accepted. * Q: _Which platforms/architectures are supported?_ - A: `linux/amd64`, `linux/arm`, `linux/arm64`, `freebsd/amd64`, `darwin/amd64`, `windows/amd64`. Pull requests for other platforms/architectures + A: `linux/amd64`, `linux/arm`, `linux/arm64`, `freebsd/amd64`, `darwin/amd64`, `darwin/arm64`, `windows/amd64`. Pull requests for other platforms/architectures are accepted. * Q: _I don't trust `libzstd*.a` binary files from the repo or these files dont't work on my OS/ARCH. How to rebuild them?_ diff --git a/vendor/github.com/valyala/gozstd/libzstd_darwin_arm64.a b/vendor/github.com/valyala/gozstd/libzstd_darwin_arm64.a index 2411f48d2..c049c24d1 100644 Binary files a/vendor/github.com/valyala/gozstd/libzstd_darwin_arm64.a and b/vendor/github.com/valyala/gozstd/libzstd_darwin_arm64.a differ diff --git a/vendor/modules.txt b/vendor/modules.txt index 483c61cd6..57fd44adc 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -208,7 +208,7 @@ github.com/valyala/fastrand # github.com/valyala/fasttemplate v1.2.1 ## explicit github.com/valyala/fasttemplate -# github.com/valyala/gozstd v1.14.1 +# github.com/valyala/gozstd v1.14.2 ## explicit github.com/valyala/gozstd # github.com/valyala/histogram v1.2.0