Skip to content

fix: reduce resolveRailwayBin execSync timeout to prevent flaky test - #46

Open
pcapriolo wants to merge 1 commit into
mainfrom
fix/flaky-railway-bin-timeout
Open

fix: reduce resolveRailwayBin execSync timeout to prevent flaky test#46
pcapriolo wants to merge 1 commit into
mainfrom
fix/flaky-railway-bin-timeout

Conversation

@pcapriolo

Copy link
Copy Markdown
Owner

What changed and why

resolveRailwayBin() in scripts/review-cron.ts probes up to 4 binary candidates using execSync with a 3000ms timeout each. On a loaded system, if one candidate took ~1.5–3s to fail, the vitest test for this function would exceed its default 5000ms test timeout, causing a flaky failure.

Binary existence checks are either:

  • instant (ENOENT — binary not found)
  • sub-100ms (binary found and responds)

500ms is more than sufficient, and eliminates the flakiness.

Tests

  • Before: 342 passing (2 flaky failures on first run due to timeout)
  • After: 342 passing (stable across 2 consecutive runs)

Verification

  • npm run test:run ✅ 342/342 passing
  • npx tsc --noEmit ✅ clean

Files changed

  • scripts/review-cron.tstimeout: 3000timeout: 500

The 3000ms exec timeout per candidate could exceed vitest's 5000ms
test timeout when multiple candidates were probed on a loaded system.
Binary existence checks are either instant (ENOENT) or sub-100ms;
500ms is more than sufficient.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant