diff --git a/pkg/storer/compact_test.go b/pkg/storer/compact_test.go index 3606e7c8c9d..4e4f883f8c1 100644 --- a/pkg/storer/compact_test.go +++ b/pkg/storer/compact_test.go @@ -55,13 +55,13 @@ func TestCompact(t *testing.T) { } } + c, unsub := st.Events().Subscribe("batchExpiryDone") + t.Cleanup(unsub) + err = st.EvictBatch(ctx, evictBatch.ID) if err != nil { t.Fatal(err) } - - c, unsub := st.Events().Subscribe("batchExpiryDone") - t.Cleanup(unsub) <-c time.Sleep(time.Second)