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/cortexproject/promqlsmith"
16
+ "github.com/prometheus/prometheus/model/labels"
17
+ "github.com/stretchr/testify/require"
18
+ "github.com/thanos-io/objstore"
19
+ "github.com/thanos-io/thanos/pkg/block"
20
+ "github.com/thanos-io/thanos/pkg/block/metadata"
21
+
9
22
"github.com/cortexproject/cortex/integration/e2e"
10
23
e2edb "github.com/cortexproject/cortex/integration/e2e/db"
11
24
"github.com/cortexproject/cortex/integration/e2ecortex"
12
25
"github.com/cortexproject/cortex/pkg/storage/bucket"
13
26
"github.com/cortexproject/cortex/pkg/storage/tsdb"
14
27
"github.com/cortexproject/cortex/pkg/util/log"
15
28
cortex_testutil "github.com/cortexproject/cortex/pkg/util/test"
16
- "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 ) {
@@ -111,6 +113,7 @@ func TestParquetFuzz(t *testing.T) {
111
113
require .NoError (t , s .StartAndWaitReady (cortex ))
112
114
113
115
storage , err := e2ecortex .NewS3ClientForMinio (minio , flags ["-blocks-storage.s3.bucket-name" ])
116
+ require .NoError (t , err )
114
117
bkt := bucket .NewUserBucketClient ("user-1" , storage .GetBucket (), nil )
115
118
116
119
err = block .Upload (ctx , log .Logger , bkt , filepath .Join (dir , id .String ()), metadata .NoneFunc )
@@ -120,13 +123,14 @@ func TestParquetFuzz(t *testing.T) {
120
123
cortex_testutil .Poll (t , 30 * time .Second , true , func () interface {} {
121
124
found := false
122
125
123
- bkt .Iter (context .Background (), "" , func (name string ) error {
126
+ err := bkt .Iter (context .Background (), "" , func (name string ) error {
124
127
fmt .Println (name )
125
128
if name == fmt .Sprintf ("parquet-markers/%v-parquet-converter-mark.json" , id .String ()) {
126
129
found = true
127
130
}
128
131
return nil
129
132
}, objstore .WithRecursiveIter ())
133
+ require .NoError (t , err )
130
134
return found
131
135
})
132
136
@@ -167,7 +171,6 @@ func TestParquetFuzz(t *testing.T) {
167
171
ps := promqlsmith .New (rnd , lbls , opts ... )
168
172
169
173
runQueryFuzzTestCases (t , ps , c1 , c2 , end , start , end , scrapeInterval , 500 , false )
170
- fmt .Println (cortex .Metrics ())
171
174
172
175
require .NoError (t , cortex .WaitSumMetricsWithOptions (e2e .Greater (0 ), []string {"cortex_parquet_queryable_blocks_queried_total" }, e2e .WithLabelMatchers (
173
176
labels .MustNewMatcher (labels .MatchEqual , "type" , "parquet" ))))
0 commit comments