Repository navigation
[rush-daemon] Fix three daemon/client tests that flake on slow agents - #6238
Open
Sean Larkin (TheLarkInn) wants to merge 1 commit into
Open
Sean Larkin (TheLarkInn) wants to merge 1 commit into
Sean Larkin (TheLarkInn) wants to merge 1 commit into
Conversation
The Rush publish pipeline's "rush retest" step failed on these tests on slow agents: - rush-client-core "waits a whole backoff step...": a 3 s deadline left no room after a late helper exit. The deadline is now 8 s, and the upper bound is derived from the backoff schedule and the time that remained. - rush-cli-client "expired-preflight": a 100 ms budget could expire during connect, before the preflight was sent. The budget is now 2 s, and the fake daemon holds the preflight reply until that budget has passed. - rush-daemon launcher attestation tests: they spawn a Node.js probe but used Jest's 5 s default timeout. They now get 15 s, like their peers. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 08766d06-fe09-43d1-b604-3b9f433d1785
This branch has not been deployed
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.
Summary
Three daemon/client tests flake on slow agents. They fail the "Rush retest" step of the Rush publish pipelines (RushStack ADO defs 10 and 12). Since the pool fix in #6220, 5 of 11 runs failed there. This PR makes the tests deterministic. It does not skip or remove any check.
Details
rush-client-core: "waits a whole backoff step between attempts once its startup helper has exited" (builds 12944, 12957)
The client's backoff keeps doubling while the helper runs. By the time the helper exits, each step is 500 ms. The test gave the whole startup 3 s. On a slow agent the helper exited late, so only one attempt fit after the exit:
Expected: > 1, Received: 1.Fix: the deadline is now 8 s. The fixed
< 10upper bound becomes a bound computed from the backoff schedule (50, 100, 200, 400, then 500 ms) and the time actually left after the exit. A client that spins still fails it.rush-cli-client: "preserves graph admission and cancellation across expired-preflight" (builds 12947, 12958)
The client ran with
--wait-timeout 0.1, and that budget includes connect and hello. On a slow agent it ran out before the client sent the preflight. The client then never sent a request, andrequests[0].argvthrew.Fix: the budget is now 2 s. The fake daemon holds the preflight reply until that budget has passed: the request's own
waitTimeoutMsplus 100 ms. So the deadline always expires during the preflight, as the test intends. The test still asserts exactly one request, exit 1, "deadline expired", and a budget at or under the requested value.rush-daemon: "attests the actual bundled engine and protocol..." (build 12945)
Attestation spawns a Node.js probe that loads rush-lib. The test used Jest's 5 s default and timed out. It now has 15 s, as the other probe-spawning tests in this file do. Its twin, "honors an explicit native preview selection", spawns the same probe and gets the same 15 s.
How it was tested
Each test was looped on Node 24.22.1, the publish pool's version, with
HTTPS_PROXYset, pinned withtasksetto the CPUs shown, alongside 3 busy-loop processes:All three projects' full test suites pass.
Other daemon flakes seen in GitHub CI are already covered by #6233 and #6153, so this PR leaves them alone.