Repository navigation
[automated] test: Replace the stapler retry JavaScript harness with C# - #21811
Open
Ankit Jain (radical) wants to merge 3 commits into
Open
Ankit Jain (radical) wants to merge 3 commits into
Ankit Jain (radical) wants to merge 3 commits into
Conversation
Move stapler retry fixture setup and assertions into the C# test instead of launching a JavaScript harness. Reuse TemporaryWorkspace and TestProcessRunner with small Bash stubs for xcrun and sleep. Cover connection-loss recovery, immediate rejection of a nonretryable exit-68 error, and exhaustion after four attempts for staple and validate. Keep the stubbed tests eligible for the existing Linux infrastructure test lane without requiring Node or Apple services. Focus coverage on retry classification, attempt counts, exit status, and backoff delays rather than retaining the broader argument, output, and cleanup checks from the JavaScript harness. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Contributor
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 21811Or
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 21811" |
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The executable test stubs can trigger a Linux ETXTBSY race in parallel tests, so they should be written using the existing ExecutableFile.WriteAsync helper.
1 open issue
What changed in this PR
Replaces the stapler retry test’s JavaScript harness with C# fixtures and assertions, removing its Node dependency while continuing to exercise the real shell script.
Changes:
- Reuses
TemporaryWorkspaceandTestProcessRunnerwith Bash stubs forxcrunandsleep. - Covers recovery, nonretryable failure, and retry exhaustion for both
stapleandvalidate. - Narrows coverage to exit status, attempt counts, and backoff delays; removes the broader harness checks and per-process timeout.
| File | Description |
|---|---|
tests/Infrastructure.Tests/Pipelines/MacOSStaplerRetryTests.cs |
Implements six retry scenarios directly in C# using shared test helpers. |
tests/Infrastructure.Tests/Pipelines/macos-stapler-retry.harness.js |
Removes the JavaScript fixture and assertion harness. |
Review effort: Balanced
Default fixture setup, process orchestration, and assertions to C# while retaining language-native harnesses when they better suit the behavior under test. Encourage reuse of TestProcessRunner and other existing utilities without introducing abstractions for a single consumer. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Ankit Jain (radical)
marked this pull request as ready for review
November 5, 2026 20:00
Ankit Jain (radical)
requested review from
Eric Erhardt (eerhardt) and
Sébastien Ros (sebastienros)
November 5, 2026 20:00
Writing executable stubs from a parallel test host can leave writable descriptors inherited by another child process. Linux can then reject execution with ETXTBSY (exit 126) instead of exercising retry behavior. Use the existing ExecutableFile writer, which creates the stub and sets its executable permissions from a short-lived child process. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
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.

Description
Replace the stapler retry JavaScript harness with C#, following this review feedback.
The C# test delegated fixture setup and assertions to Node just to exercise a
Bash script, adding an unnecessary language hop and runtime dependency.
Run the real script from C# using
TemporaryWorkspaceandTestProcessRunner.Small Bash stubs replace
xcrunandsleep, avoiding Apple services and realbackoff waits. Six cases check recovery, nonretryable exit 68, and retry
exhaustion for both
stapleandvalidate.Write executable stubs through
ExecutableFile.WriteAsyncto avoid LinuxETXTBSY("Text file busy", exit 126) failures when parallel tests inheritwritable descriptors. The helper writes and sets permissions in a short-lived
child rather than the test host.
Infrastructure guidance now defaults to C# tests and harnesses, with other
languages appropriate when they better suit the behavior under test.
Coverage changes
Coverage intentionally focuses on exit status, attempt count, and backoff.
Additional error/stdout cases, changing-error sequences, argument/quoting,
output-text, and temporary-file cleanup assertions are not retained.
The former per-process timeout is replaced by the existing project timeout.
Validation
Local command: 14 selected tests passed on macOS ARM64
Fixes # (issue)
Checklist
<remarks />and<code />elements on your triple slash comments?