From 544821b7193a1b523160294712602cdfc6654bc0 Mon Sep 17 00:00:00 2001 From: Aliaksandr Valialkin Date: Thu, 8 Apr 2021 00:17:11 +0300 Subject: [PATCH] app/vmselect/promql: fix tests after d3fa0ccabdd56bf9997b3253e711ca120008ec70 --- app/vmselect/promql/exec_test.go | 44 ++++++++++++++++---------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/app/vmselect/promql/exec_test.go b/app/vmselect/promql/exec_test.go index f6bfcc1ea..61d9318ff 100644 --- a/app/vmselect/promql/exec_test.go +++ b/app/vmselect/promql/exec_test.go @@ -4756,25 +4756,25 @@ func TestExecSuccess(t *testing.T) { }) t.Run(`topk(1)`, func(t *testing.T) { t.Parallel() - q := `sort(topk(1, label_set(10, "foo", "bar") or label_set(time()/150, "baz", "sss")))` + q := `topk(1, label_set(10, "foo", "bar") or label_set(time()/150, "baz", "sss"))` r1 := netstorage.Result{ - MetricName: metricNameExpected, - Values: []float64{10, 10, 10, nan, nan, nan}, - Timestamps: timestampsExpected, - } - r1.MetricName.Tags = []storage.Tag{{ - Key: []byte("foo"), - Value: []byte("bar"), - }} - r2 := netstorage.Result{ MetricName: metricNameExpected, Values: []float64{nan, nan, nan, 10.666666666666666, 12, 13.333333333333334}, Timestamps: timestampsExpected, } - r2.MetricName.Tags = []storage.Tag{{ + r1.MetricName.Tags = []storage.Tag{{ Key: []byte("baz"), Value: []byte("sss"), }} + r2 := netstorage.Result{ + MetricName: metricNameExpected, + Values: []float64{10, 10, 10, nan, nan, nan}, + Timestamps: timestampsExpected, + } + r2.MetricName.Tags = []storage.Tag{{ + Key: []byte("foo"), + Value: []byte("bar"), + }} resultExpected := []netstorage.Result{r1, r2} f(q, resultExpected) }) @@ -5047,25 +5047,25 @@ func TestExecSuccess(t *testing.T) { }) t.Run(`bottomk(1)`, func(t *testing.T) { t.Parallel() - q := `sort(bottomk(1, label_set(10, "foo", "bar") or label_set(time()/150, "baz", "sss")))` + q := `bottomk(1, label_set(10, "foo", "bar") or label_set(time()/150, "baz", "sss"))` r1 := netstorage.Result{ - MetricName: metricNameExpected, - Values: []float64{6.666666666666667, 8, 9.333333333333334, nan, nan, nan}, - Timestamps: timestampsExpected, - } - r1.MetricName.Tags = []storage.Tag{{ - Key: []byte("baz"), - Value: []byte("sss"), - }} - r2 := netstorage.Result{ MetricName: metricNameExpected, Values: []float64{nan, nan, nan, 10, 10, 10}, Timestamps: timestampsExpected, } - r2.MetricName.Tags = []storage.Tag{{ + r1.MetricName.Tags = []storage.Tag{{ Key: []byte("foo"), Value: []byte("bar"), }} + r2 := netstorage.Result{ + MetricName: metricNameExpected, + Values: []float64{6.666666666666667, 8, 9.333333333333334, nan, nan, nan}, + Timestamps: timestampsExpected, + } + r2.MetricName.Tags = []storage.Tag{{ + Key: []byte("baz"), + Value: []byte("sss"), + }} resultExpected := []netstorage.Result{r1, r2} f(q, resultExpected) })