From 272a5d3d4552f5114b597c9b690da7963eaf69dd Mon Sep 17 00:00:00 2001 From: hmanukyan Date: Mon, 2 Oct 2023 15:22:47 +0400 Subject: [PATCH] Fix changres --- .../acceptance/metric-store/metric_store_test.go | 16 ++++++++-------- src/internal/metric-store/metric_store_test.go | 4 +++- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/src/internal/acceptance/metric-store/metric_store_test.go b/src/internal/acceptance/metric-store/metric_store_test.go index d5094ffc6..01a8cd3c0 100644 --- a/src/internal/acceptance/metric-store/metric_store_test.go +++ b/src/internal/acceptance/metric-store/metric_store_test.go @@ -652,7 +652,7 @@ scrape_configs: }, ) - time.Sleep(time.Millisecond * 100) + time.Sleep(time.Second) value, err := makeInstantQuery(tc, testInstantQuery{ Query: "metric_name", TimeInSeconds: transform.MillisecondsToString(firstTimeMilliseconds + 1000), @@ -689,7 +689,7 @@ scrape_configs: }, }, ) - time.Sleep(time.Millisecond * 100) + time.Sleep(time.Second) value, err := makeInstantQuery(tc, testInstantQuery{ Query: MAGIC_MEASUREMENT_PEER_NAME, TimeInSeconds: transform.MillisecondsToString(firstTimeMilliseconds + 1000), @@ -735,7 +735,7 @@ scrape_configs: }, ) - time.Sleep(time.Millisecond * 100) + time.Sleep(time.Second) value, err := makeInstantQuery(tc, testInstantQuery{ Query: "metric_name_for_node_0+metric_name_for_node_1", TimeInSeconds: transform.MillisecondsToString(firstTimeMilliseconds + 1000), @@ -798,7 +798,7 @@ scrape_configs: }, ) - time.Sleep(time.Millisecond * 100) + time.Sleep(time.Second) value, err := makeRangeQuery(tc, testRangeQuery{ Query: "metric_name", StartInSeconds: transform.MillisecondsToString(firstTimeMilliseconds + 1000), @@ -849,7 +849,7 @@ scrape_configs: }, ) - time.Sleep(time.Millisecond * 100) + time.Sleep(time.Second) value, err := makeRangeQuery(tc, testRangeQuery{ Query: "metric_name_for_node_1", StartInSeconds: transform.MillisecondsToString(firstTimeMilliseconds), @@ -908,7 +908,7 @@ scrape_configs: }, ) - time.Sleep(time.Millisecond * 100) + time.Sleep(time.Second) value, err := makeRangeQuery(tc, testRangeQuery{ Query: "metric_name_for_node_0 + metric_name_for_node_1", StartInSeconds: transform.MillisecondsToString(firstTimeMilliseconds + 1000), @@ -1045,7 +1045,7 @@ scrape_configs: }, ) - time.Sleep(time.Millisecond * 100) + time.Sleep(time.Second) value, err := makeSeriesQuery(tc, testSeriesQuery{ Match: []string{"metric_name"}, StartInSeconds: transform.MillisecondsToString(firstTimeMilliseconds), @@ -1122,7 +1122,7 @@ scrape_configs: }, ) - time.Sleep(time.Millisecond * 100) + time.Sleep(time.Second) value, err := makeSeriesQuery(tc, testSeriesQuery{ Match: []string{"metric_name_for_node_0", "metric_name_for_node_1"}, StartInSeconds: transform.MillisecondsToString(firstTimeMilliseconds), diff --git a/src/internal/metric-store/metric_store_test.go b/src/internal/metric-store/metric_store_test.go index 221b02bdd..2d179d8a9 100644 --- a/src/internal/metric-store/metric_store_test.go +++ b/src/internal/metric-store/metric_store_test.go @@ -26,6 +26,8 @@ import ( "github.com/influxdata/influxql" . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/extensions/table" + . "github.com/onsi/gomega" prom_api_client "github.com/prometheus/client_golang/api/prometheus/v1" "github.com/prometheus/client_golang/prometheus" config_util "github.com/prometheus/common/config" @@ -334,7 +336,7 @@ var _ = Describe("MetricStore", func() { {Timestamp: now.Add(2 * time.Second).UnixNano(), Name: MAGIC_MEASUREMENT_PEER_NAME}, }) tc.peer.Resume() - time.Sleep(time.Millisecond * 500) + time.Sleep(time.Second) Eventually(tc.peer.GetInternodePoints).Should(HaveLen(2)) Expect(tc.peer.GetInternodePoints()[0].Timestamp).To(Equal(now.Add(time.Second).UnixNano()))