@@ -273,7 +273,8 @@ func TestIndex_Query(t *testing.T) {
273
273
}
274
274
275
275
func Test_QueryConcurrency (t * testing.T ) {
276
- for i := 0 ; i < 3 && ! t .Failed (); i ++ {
276
+ const N = 1
277
+ for i := 0 ; i < N && ! t .Failed (); i ++ {
277
278
q := new (queryTestSuite )
278
279
q .run (t )
279
280
}
@@ -356,23 +357,23 @@ func (s *queryTestSuite) run(t *testing.T) {
356
357
357
358
s .runQuery (t , s .queryBlocks )
358
359
s .runQuery (t , s .queryLabels )
359
- s .runQuery (t , s .findCompactedBlocks )
360
+ s .runQuery (t , s .getBlocks )
360
361
361
- // Stop the test after 5 seconds,
362
- // if the test is still running.
363
362
go func () {
364
363
select {
365
364
case <- s .stop :
366
- case <- time .After (5 * time .Second ):
365
+ case <- time .After (30 * time .Second ):
367
366
t .Error ("test time out: query consistency not confirmed" )
368
367
s .doStop ()
369
368
}
370
369
}()
371
370
372
371
s .wg .Wait ()
372
+
373
373
// If we haven't failed the test, we can conclude that
374
374
// no races, no deadlocks, no inconsistencies were found.
375
375
s .doStop ()
376
+
376
377
// Wait for the write goroutine to finish, so we can
377
378
// safely tear down the test.
378
379
<- done
@@ -579,7 +580,7 @@ func (s *queryTestSuite) queryLabels(t *testing.T) (ret int32) {
579
580
return sourceBlocks | compactedBlocks
580
581
}
581
582
582
- func (s * queryTestSuite ) findCompactedBlocks (t * testing.T ) (ret int32 ) {
583
+ func (s * queryTestSuite ) getBlocks (t * testing.T ) (ret int32 ) {
583
584
var x []* metastorev1.BlockMeta
584
585
var err error
585
586
require .NoError (t , s .db .View (func (tx * bbolt.Tx ) error {
0 commit comments