Skip to content

Commit 8b278ee

Browse files
committed
metamorphic: bump timeout for Compact/Download/NewSnapshot
Bump up the timeout for these ops, which can be very slow if both the block size and target file size are small and we end up with a ton of tiny tables. Informs #3618
1 parent cd25400 commit 8b278ee

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

metamorphic/test.go

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -408,8 +408,15 @@ func (t *Test) runOp(idx int, h historyRecorder) {
408408
op := t.ops[idx]
409409
var timer *time.Timer
410410
if t.opTimeout > 0 {
411-
timer = time.AfterFunc(t.opTimeout, func() {
412-
panic(fmt.Sprintf("operation took longer than %s: %s", t.opTimeout, op.String()))
411+
opTimeout := t.opTimeout
412+
switch op.(type) {
413+
case *compactOp, *downloadOp, *newSnapshotOp, *ingestOp, *ingestAndExciseOp, *ingestExternalFilesOp:
414+
// These ops can be very slow, especially if we end up with many tiny
415+
// tables. Bump up the timout by a factor.
416+
opTimeout *= 4
417+
}
418+
timer = time.AfterFunc(opTimeout, func() {
419+
panic(fmt.Sprintf("operation took longer than %s: %s", opTimeout, op.String()))
413420
})
414421
}
415422
op.run(t, h)

0 commit comments

Comments
 (0)