From c27710c4ba18faaf07df1c441542ce805417aafd Mon Sep 17 00:00:00 2001 From: Owen Diehl Date: Tue, 31 Oct 2023 10:46:14 -0700 Subject: [PATCH] waitgroup for test timing Signed-off-by: Owen Diehl --- pkg/storage/bloom/v1/fuse_test.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/pkg/storage/bloom/v1/fuse_test.go b/pkg/storage/bloom/v1/fuse_test.go index f24722af6343e..38554463e9214 100644 --- a/pkg/storage/bloom/v1/fuse_test.go +++ b/pkg/storage/bloom/v1/fuse_test.go @@ -3,6 +3,7 @@ package v1 import ( "bytes" "context" + "sync" "testing" "github.com/grafana/dskit/concurrency" @@ -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(), @@ -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 {