mirror of
https://github.com/prometheus/prometheus.git
synced 2025-01-26 05:01:23 -08:00
simplify nesting.
Signed-off-by: Krasi Georgiev <kgeorgie@redhat.com>
This commit is contained in:
parent
2ae0620205
commit
457534d5c4
|
@ -772,21 +772,16 @@ 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.
|
||||
var start time.Time
|
||||
for {
|
||||
if prom_testutil.ToFloat64(db.compactor.(*LeveledCompactor).metrics.populatingBlocks) > 0 {
|
||||
start = time.Now()
|
||||
break
|
||||
}
|
||||
for prom_testutil.ToFloat64(db.compactor.(*LeveledCompactor).metrics.populatingBlocks) <= 0 {
|
||||
time.Sleep(3 * time.Millisecond)
|
||||
}
|
||||
start = time.Now()
|
||||
|
||||
for {
|
||||
if prom_testutil.ToFloat64(db.compactor.(*LeveledCompactor).metrics.ran) == 1 {
|
||||
timeCompactionUninterrupted = time.Since(start)
|
||||
break
|
||||
}
|
||||
for prom_testutil.ToFloat64(db.compactor.(*LeveledCompactor).metrics.ran) != 1 {
|
||||
time.Sleep(3 * time.Millisecond)
|
||||
}
|
||||
timeCompactionUninterrupted = time.Since(start)
|
||||
|
||||
testutil.Ok(t, db.Close())
|
||||
}
|
||||
// Measure the compaction time when closing the db in the middle of compaction.
|
||||
|
|
Loading…
Reference in a new issue