Skip to content

Commit e2b5667

Browse files
TMHSDigitalclaude
andcommitted
test(scan): pace the flat resume test so the interrupt lands mid-scan
Unpaced, a 400-entry simulated scan could finish before the consumer's cancel took effect, leaving nothing to resume (failed 2 of 8 runs). -rate 2000 gives it ~0.2s; 15 of 15 runs pass. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent 20f10f0 commit e2b5667

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

‎internal/scan/resume_test.go‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,11 @@ func TestResumeMatchesUninterruptedRun(t *testing.T) {
4242
Simulate: true, HitRate: 10, Seed: 42, Attempts: 1,
4343
Recursive: recursive, Depth: 2,
4444
}
45+
if !recursive {
46+
// Unpaced, a flat simulated scan can finish before the
47+
// interrupt lands; 2000 names/s gives it ~0.2s to run.
48+
cfg.Rate = 2000
49+
}
4550
want, _ := runCollect(t, cfg, 0)
4651

4752
partial, stats := runCollect(t, cfg, len(want)/2)

0 commit comments

Comments
 (0)