fix the sleep logic

Signed-off-by: Krasi Georgiev <kgeorgie@redhat.com>
This commit is contained in:
Krasi Georgiev 2019-02-08 12:39:25 +02:00
parent 457534d5c4
commit da9da9fbee

View file

@ -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()