diff --git a/compact_test.go b/compact_test.go index fa977879dd..fa80ad6300 100644 --- a/compact_test.go +++ b/compact_test.go @@ -794,13 +794,13 @@ func TestCancelCompactions(t *testing.T) { dbClosed := make(chan struct{}) for { if prom_testutil.ToFloat64(db.compactor.(*LeveledCompactor).metrics.populatingBlocks) > 0 { - time.Sleep(3 * time.Millisecond) go func() { testutil.Ok(t, db.Close()) close(dbClosed) }() break } + time.Sleep(3 * time.Millisecond) } start := time.Now()