mirror of
https://github.com/prometheus/prometheus.git
synced 2025-01-13 06:47:28 -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")
|
testutil.Equals(t, 0.0, prom_testutil.ToFloat64(db.compactor.(*LeveledCompactor).metrics.ran), "initial compaction counter mismatch")
|
||||||
db.compactc <- struct{}{} // Trigger a compaction.
|
db.compactc <- struct{}{} // Trigger a compaction.
|
||||||
dbClosed := make(chan struct{})
|
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 {
|
||||||
go func() {
|
|
||||||
testutil.Ok(t, db.Close())
|
|
||||||
close(dbClosed)
|
|
||||||
}()
|
|
||||||
break
|
|
||||||
}
|
|
||||||
time.Sleep(3 * time.Millisecond)
|
time.Sleep(3 * time.Millisecond)
|
||||||
}
|
}
|
||||||
|
go func() {
|
||||||
|
testutil.Ok(t, db.Close())
|
||||||
|
close(dbClosed)
|
||||||
|
}()
|
||||||
|
|
||||||
start := time.Now()
|
start := time.Now()
|
||||||
<-dbClosed
|
<-dbClosed
|
||||||
|
|
Loading…
Reference in a new issue