Commit 049413b
test: fix flaky requestHandlerTimeoutSecs test properly (#3343)
## Summary
- Fixes the flaky `should respect the requestHandlerTimeoutSecs option`
test in `browser_crawler.test.ts`
- The previous fix (#3340) used `vitest.useFakeTimers({
shouldAdvanceTime: true })` which doesn't address the root cause
- The actual issue is a race condition: if `crawler.run()` takes longer
than ~1 second to complete cleanup after the 500ms timeout, the 1500ms
"bad" timer fires before assertions run
- This fix increases the "bad" timer delay from 1500ms to 60000ms so it
can never fire during test execution, regardless of CPU load from
parallel tests
## Test plan
- [x] Ran `yarn test` 5 times - all passed (one run had a different
unrelated test fail)
- [x] The fix is simple and eliminates the race condition entirely
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>1 parent e025934 commit 049413b
1 file changed
Lines changed: 3 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
427 | 427 | | |
428 | 428 | | |
429 | 429 | | |
430 | | - | |
431 | 430 | | |
432 | 431 | | |
433 | 432 | | |
434 | 433 | | |
435 | 434 | | |
436 | 435 | | |
437 | 436 | | |
| 437 | + | |
| 438 | + | |
438 | 439 | | |
439 | 440 | | |
440 | 441 | | |
441 | 442 | | |
442 | 443 | | |
443 | 444 | | |
444 | 445 | | |
445 | | - | |
| 446 | + | |
446 | 447 | | |
447 | 448 | | |
448 | 449 | | |
| |||
453 | 454 | | |
454 | 455 | | |
455 | 456 | | |
456 | | - | |
457 | 457 | | |
458 | 458 | | |
459 | 459 | | |
| |||
0 commit comments