1- //go:build integration
2- // +build integration
1+ //go:build integration_query_fuzz
2+ // +build integration_query_fuzz
33
44package integration
55
66import (
77 "context"
88 "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+
921 "github.com/cortexproject/cortex/integration/e2e"
1022 e2edb "github.com/cortexproject/cortex/integration/e2e/db"
1123 "github.com/cortexproject/cortex/integration/e2ecortex"
@@ -14,16 +26,6 @@ import (
1426 "github.com/cortexproject/cortex/pkg/util/log"
1527 cortex_testutil "github.com/cortexproject/cortex/pkg/util/test"
1628 "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"
2729)
2830
2931func TestParquetFuzz (t * testing.T ) {
@@ -111,6 +113,7 @@ func TestParquetFuzz(t *testing.T) {
111113 require .NoError (t , s .StartAndWaitReady (cortex ))
112114
113115 storage , err := e2ecortex .NewS3ClientForMinio (minio , flags ["-blocks-storage.s3.bucket-name" ])
116+ require .NoError (t , err )
114117 bkt := bucket .NewUserBucketClient ("user-1" , storage .GetBucket (), nil )
115118
116119 err = block .Upload (ctx , log .Logger , bkt , filepath .Join (dir , id .String ()), metadata .NoneFunc )
@@ -120,13 +123,14 @@ func TestParquetFuzz(t *testing.T) {
120123 cortex_testutil .Poll (t , 30 * time .Second , true , func () interface {} {
121124 found := false
122125
123- bkt .Iter (context .Background (), "" , func (name string ) error {
126+ err := bkt .Iter (context .Background (), "" , func (name string ) error {
124127 fmt .Println (name )
125128 if name == fmt .Sprintf ("parquet-markers/%v-parquet-converter-mark.json" , id .String ()) {
126129 found = true
127130 }
128131 return nil
129132 }, objstore .WithRecursiveIter ())
133+ require .NoError (t , err )
130134 return found
131135 })
132136
@@ -167,7 +171,6 @@ func TestParquetFuzz(t *testing.T) {
167171 ps := promqlsmith .New (rnd , lbls , opts ... )
168172
169173 runQueryFuzzTestCases (t , ps , c1 , c2 , end , start , end , scrapeInterval , 500 , false )
170- fmt .Println (cortex .Metrics ())
171174
172175 require .NoError (t , cortex .WaitSumMetricsWithOptions (e2e .Greater (0 ), []string {"cortex_parquet_queryable_blocks_queried_total" }, e2e .WithLabelMatchers (
173176 labels .MustNewMatcher (labels .MatchEqual , "type" , "parquet" ))))
0 commit comments