Skip to content

Commit 79b57ae

Browse files
committed
history: fix TestExploreTDTV
It was busy looping and not doing at all what it was supposed to.
1 parent 258a5e4 commit 79b57ae

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

pkg/kv/kvserver/asim/history/trashing_test.go

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -177,16 +177,19 @@ func TestExploreTDTV(t *testing.T) {
177177
// You can paste a time series copied from viewer.html here to explore
178178
// the variation of its prefixes.
179179
0,
180-
0,
180+
1,
181+
2,
182+
3,
183+
2,
181184
}
182185
testutils.RunTrueAndFalse(t, "stripped", func(t *testing.T, stripped bool) {
183186
sl := sl
184187
if stripped {
185188
sl = stripLeaderingZeroes(sl)
186189
}
187-
for i := len(sl) / 100; i < len(sl); i += len(sl) / 100 {
190+
const step = 100
191+
for i := min(step, len(sl)); i <= len(sl); i += min(step, len(sl)-i+1) {
188192
t.Logf("sl[:%d]: %+v", i, computeThrashing(sl[:i]))
189193
}
190-
191194
})
192195
}

0 commit comments

Comments
 (0)