From da9da9fbeeb4a16801f366d5ae25e83cd37fd828 Mon Sep 17 00:00:00 2001 From: Krasi Georgiev Date: Fri, 8 Feb 2019 12:39:25 +0200 Subject: [PATCH] fix the sleep logic Signed-off-by: Krasi Georgiev --- compact_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compact_test.go b/compact_test.go index fa977879d..fa80ad630 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()