mirror of
https://github.com/prometheus/prometheus.git
synced 2024-12-25 13:44:05 -08:00
remove nested for if
Signed-off-by: Krasi Georgiev <kgeorgie@redhat.com>
This commit is contained in:
parent
da9da9fbee
commit
0f8f5027ef
|
@ -792,16 +792,14 @@ func TestCancelCompactions(t *testing.T) {
|
|||
testutil.Equals(t, 0.0, prom_testutil.ToFloat64(db.compactor.(*LeveledCompactor).metrics.ran), "initial compaction counter mismatch")
|
||||
db.compactc <- struct{}{} // Trigger a compaction.
|
||||
dbClosed := make(chan struct{})
|
||||
for {
|
||||
if prom_testutil.ToFloat64(db.compactor.(*LeveledCompactor).metrics.populatingBlocks) > 0 {
|
||||
|
||||
for 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()
|
||||
<-dbClosed
|
||||
|
|
Loading…
Reference in a new issue