1
- //go:build integration
2
- // +build integration
1
+ //go:build integration_query_fuzz
2
+ // +build integration_query_fuzz
3
3
4
4
package integration
5
5
6
6
import (
7
7
"context"
8
8
"fmt"
9
+ "math/rand"
10
+ "path/filepath"
11
+ "strconv"
12
+ "testing"
13
+ "time"
14
+
15
+ "github.com/prometheus/prometheus/model/labels"
16
+ "github.com/stretchr/testify/require"
17
+ "github.com/thanos-io/objstore"
18
+ "github.com/thanos-io/thanos/pkg/block"
19
+ "github.com/thanos-io/thanos/pkg/block/metadata"
20
+
9
21
"github.com/cortexproject/cortex/integration/e2e"
10
22
e2edb "github.com/cortexproject/cortex/integration/e2e/db"
11
23
"github.com/cortexproject/cortex/integration/e2ecortex"
@@ -14,16 +26,6 @@ import (
14
26
"github.com/cortexproject/cortex/pkg/util/log"
15
27
cortex_testutil "github.com/cortexproject/cortex/pkg/util/test"
16
28
"github.com/cortexproject/promqlsmith"
17
- "github.com/prometheus/prometheus/model/labels"
18
- "github.com/stretchr/testify/require"
19
- "github.com/thanos-io/objstore"
20
- "github.com/thanos-io/thanos/pkg/block"
21
- "github.com/thanos-io/thanos/pkg/block/metadata"
22
- "math/rand"
23
- "path/filepath"
24
- "strconv"
25
- "testing"
26
- "time"
27
29
)
28
30
29
31
func TestParquetFuzz (t * testing.T ) {
@@ -120,13 +122,14 @@ func TestParquetFuzz(t *testing.T) {
120
122
cortex_testutil .Poll (t , 30 * time .Second , true , func () interface {} {
121
123
found := false
122
124
123
- bkt .Iter (context .Background (), "" , func (name string ) error {
125
+ err := bkt .Iter (context .Background (), "" , func (name string ) error {
124
126
fmt .Println (name )
125
127
if name == fmt .Sprintf ("parquet-markers/%v-parquet-converter-mark.json" , id .String ()) {
126
128
found = true
127
129
}
128
130
return nil
129
131
}, objstore .WithRecursiveIter ())
132
+ require .NoError (t , err )
130
133
return found
131
134
})
132
135
@@ -167,8 +170,7 @@ func TestParquetFuzz(t *testing.T) {
167
170
ps := promqlsmith .New (rnd , lbls , opts ... )
168
171
169
172
runQueryFuzzTestCases (t , ps , c1 , c2 , end , start , end , scrapeInterval , 500 , false )
170
- fmt .Println (cortex .Metrics ())
171
-
173
+
172
174
require .NoError (t , cortex .WaitSumMetricsWithOptions (e2e .Greater (0 ), []string {"cortex_parquet_queryable_blocks_queried_total" }, e2e .WithLabelMatchers (
173
175
labels .MustNewMatcher (labels .MatchEqual , "type" , "parquet" ))))
174
176
}
0 commit comments