mirror of
https://github.com/prometheus/prometheus.git
synced 2025-01-11 13:57:36 -08:00
test(tsdb): break up repeated test to avoid timeout (#10671)
On macOS, the TestTombstoneCleanRetentionLimitsRace performs very poorly. It takes more than a second to write out one block, and as it writes 400 of them, we run into the 10-minute test timeout frequently. While this doesn't fix the actual performance issue, breaking each iteration into a subtest makes the test pass reliably (because each iteration comfortably finishes in under a minute). Related report: https://groups.google.com/g/prometheus-developers/c/jxQ6Ayg6VJ4/m/03H_DS9PDAAJ Signed-off-by: Matthias Rampke <matthias@prometheus.io>
This commit is contained in:
parent
eb1617ebd5
commit
78f2645787
|
@ -1281,6 +1281,7 @@ func TestTombstoneCleanRetentionLimitsRace(t *testing.T) {
|
|||
//
|
||||
// That is something tricky to trigger, so let's try several times just to make sure.
|
||||
for i := 0; i < 20; i++ {
|
||||
t.Run(fmt.Sprintf("iteration%d", i), func(t *testing.T) {
|
||||
db := openTestDB(t, opts, nil)
|
||||
totalBlocks := 20
|
||||
dbDir := db.Dir()
|
||||
|
@ -1313,6 +1314,7 @@ func TestTombstoneCleanRetentionLimitsRace(t *testing.T) {
|
|||
wg.Wait()
|
||||
|
||||
require.NoError(t, db.Close())
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue