Skip to content

Let the readiness bound alone end the Pi startup tests - #424

Merged
abhishekgahlot2 merged 1 commit into
mainfrom
fix/pi-startup-bound-test
Nov 5, 2026
Merged

abhishekgahlot2 merged 1 commit into
mainfrom
fix/pi-startup-bound-test

Conversation

@abhishekgahlot2

@abhishekgahlot2 abhishekgahlot2 commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor
  • Fixes the flaky pi-rpc-bridge.test.ts case "bounds startup when PTY connection never settles" (seen on Wait for the earlier turn to finish instead of asserting it stayed queued #423 CI: Received "startup stayed pending").
  • Startup retries once with a fresh readiness bound, so a 40 ms outside timer lost to that retry whenever the event loop stalled.
  • Both startup tests now await startup plainly, check the readiness timeout, and check both attempts were created and torn down.
  • Test-only change; 50 looped runs pass, also with a simulated 50 ms stall that failed the old tests every time.

Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

The two Pi startup tests raced a 40 ms outside timer against startup. A PTY that never settles fails startup through its 5 ms readiness bound, then once more through the retry's own fresh bound. When the event loop stalled past both deadlines (CI load), the first bound and the outside timer fired together and the retry armed a new bound after the outside timer, so the test saw 'startup stayed pending' instead of the readiness timeout.

The readiness timeout is the right outcome, so the tests now await startup plainly and check it ended with that error, after both attempts were created and torn down. Awaited plainly because expect().rejects on a pending promise holds off Bun's test timeout; a startup that never ends still fails at that timeout. 50 looped runs pass, also with a 50 ms event-loop stall that failed the old tests every time.
@abhishekgahlot2
abhishekgahlot2 merged commit d05ef79 into main Nov 5, 2026
20 checks passed
@github-actions github-actions Bot locked and limited conversation to collaborators Nov 5, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant