Repository navigation
test(cli): gate worker restart RPC assertions on worker readiness (#873) - #874
Merged
Merged
Conversation
The stranded-RPC crash/restart test issued callWorkSoon against the respawned worker before it announced application-level readiness, letting slow worker boot consume the 5s retry budget on loaded runners (observed on Windows CI). Chain the message handler so the test can observe the worker's "ready" announcement and gate both phases on it, mirroring the sibling IPC test. Assertions and all budgets unchanged. Refs #873
|
This PR doesn't fully meet our contributing guidelines and PR template. What needs to be fixed:
Please edit this PR description to address the above within 2 hours, or it will be automatically closed. If you believe this was flagged incorrectly, please let a maintainer know. |
|
Thanks for your contribution! This PR doesn't have a linked issue. All PRs must reference an existing issue. Please:
See CONTRIBUTING.md for details. |
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Files Reviewed (1 files)
Reviewed by free · Input: 41.4K · Output: 5K · Cached: 159.7K |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue for this PR
Fixes #873
Type of change
What does this PR do?
Readiness hardening for the worker crash/restart RPC test — not a proven Windows fix (see verification honesty note below).
test/cli/worker-process.integration.test.ts— the test "rejects a stranded RPC across a crash and serves new calls after restart" issued its post-restartcallWorkSoonagainst the respawned worker before that worker announced application-level readiness. The host's own contract (waitForRestartinworker-process.ts) documents that restart completion is not readiness. On a loaded runner the replacement worker's boot can consume the 5scallWorkSoonretry budget before it is serving, failing the assertion at line 169 — the failure observed on Windows CI in #871's earlier head.The change chains the worker's
onmessagehandler (the RPC client remains the handler owner; the worker's"ready"announcement is a non-JSON string the RPC handler ignores, so the chain only observes) and gates both phases on the announcement:waitForCount(ready, 1)before the firstcallWorkSoon, andwaitForCount(ready, readyBefore + 1)after the bounded restart — mirroring the sibling "communicates over real Bun IPC" test, which already uses this exact pattern.Only the test file changes (+16/-0). No source, no workflow, no timeout or budget changes: the
bounded15s,waitForCount5s and the 5s RPC retry budgets are all preserved, and the crash / stranded-RPC / restart assertions are untouched. The failure stays bounded and loud:waitForCountthrows with a clear message at its deadline.How did you verify your code works?
87a0d5a38c76213b89a24b66bb2407638b30a6b26ac22334ee4580f7a69bf06b, post-image blobc94b59b3f3ef7057259e231f9373f3697f2665a0): handler chaining, RPC ownership, and the host's documented readiness contract verified against source; test contract preserved, not loosened.Screenshots / recordings
N/A — test-only change.
Checklist