Skip to content

Commit

Permalink
waitgroup for test timing
Browse files Browse the repository at this point in the history
Signed-off-by: Owen Diehl <[email protected]>
  • Loading branch information
owen-d committed Oct 31, 2023
1 parent 6e8c8f2 commit c27710c
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions pkg/storage/bloom/v1/fuse_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package v1
import (
"bytes"
"context"
"sync"
"testing"

"github.com/grafana/dskit/concurrency"
Expand Down Expand Up @@ -61,6 +62,8 @@ func TestFusedQuerier(t *testing.T) {
}

resps := make([][]output, nReqs)
var g sync.WaitGroup
g.Add(1)
go func() {
require.Nil(t, concurrency.ForEachJob(
context.Background(),
Expand All @@ -73,10 +76,16 @@ func TestFusedQuerier(t *testing.T) {
return nil
},
))
g.Done()
}()

fused := querier.Fuse(itrs)

require.Nil(t, fused.Run())
for _, input := range inputs {
close(input[0].response)
}
g.Wait()

for i, input := range inputs {
for j, req := range input {
Expand Down

0 comments on commit c27710c

Please sign in to comment.