mirror of
https://github.com/prometheus/prometheus.git
synced 2025-03-05 20:59:13 -08:00
fix the sleep logic
Signed-off-by: Krasi Georgiev <kgeorgie@redhat.com>
This commit is contained in:
parent
457534d5c4
commit
da9da9fbee
|
@ -794,13 +794,13 @@ func TestCancelCompactions(t *testing.T) {
|
||||||
dbClosed := make(chan struct{})
|
dbClosed := make(chan struct{})
|
||||||
for {
|
for {
|
||||||
if prom_testutil.ToFloat64(db.compactor.(*LeveledCompactor).metrics.populatingBlocks) > 0 {
|
if prom_testutil.ToFloat64(db.compactor.(*LeveledCompactor).metrics.populatingBlocks) > 0 {
|
||||||
time.Sleep(3 * time.Millisecond)
|
|
||||||
go func() {
|
go func() {
|
||||||
testutil.Ok(t, db.Close())
|
testutil.Ok(t, db.Close())
|
||||||
close(dbClosed)
|
close(dbClosed)
|
||||||
}()
|
}()
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
time.Sleep(3 * time.Millisecond)
|
||||||
}
|
}
|
||||||
|
|
||||||
start := time.Now()
|
start := time.Now()
|
||||||
|
|
Loading…
Reference in a new issue