mirror of
https://github.com/prometheus/prometheus.git
synced 2025-03-05 20:59:13 -08:00
fix flaky tests: TestDisableAutoCompactions,TestBlockRanges (#472)
Signed-off-by: Krasi Georgiev <kgeorgie@redhat.com>
This commit is contained in:
parent
cbfda5a801
commit
a2779cc901
|
@ -733,7 +733,7 @@ func TestDisableAutoCompactions(t *testing.T) {
|
||||||
case db.compactc <- struct{}{}:
|
case db.compactc <- struct{}{}:
|
||||||
default:
|
default:
|
||||||
}
|
}
|
||||||
for x := 0; x < 20; x++ {
|
for x := 0; x < 100; x++ {
|
||||||
if len(db.Blocks()) > 0 {
|
if len(db.Blocks()) > 0 {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
|
|
@ -1493,7 +1493,7 @@ func TestBlockRanges(t *testing.T) {
|
||||||
|
|
||||||
testutil.Ok(t, err)
|
testutil.Ok(t, err)
|
||||||
testutil.Ok(t, app.Commit())
|
testutil.Ok(t, app.Commit())
|
||||||
for x := 1; x < 10; x++ {
|
for x := 0; x < 100; x++ {
|
||||||
if len(db.Blocks()) == 2 {
|
if len(db.Blocks()) == 2 {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
@ -1533,7 +1533,7 @@ func TestBlockRanges(t *testing.T) {
|
||||||
_, err = app.Add(lbl, thirdBlockMaxt+rangeToTriggercompaction, rand.Float64()) // Trigger a compaction
|
_, err = app.Add(lbl, thirdBlockMaxt+rangeToTriggercompaction, rand.Float64()) // Trigger a compaction
|
||||||
testutil.Ok(t, err)
|
testutil.Ok(t, err)
|
||||||
testutil.Ok(t, app.Commit())
|
testutil.Ok(t, app.Commit())
|
||||||
for x := 1; x < 10; x++ {
|
for x := 0; x < 100; x++ {
|
||||||
if len(db.Blocks()) == 4 {
|
if len(db.Blocks()) == 4 {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue