Skip to content

Temporarily disable the macOS CLI unit-test lane - #21385

Merged
Mitch Denny (mitchdenny) merged 1 commit into
mainfrom
dev/karolz/macos-cli-containment
Oct 29, 2026
Merged

Mitch Denny (mitchdenny) merged 1 commit into
mainfrom
dev/karolz/macos-cli-containment

Conversation

@karolz-ms

Copy link
Copy Markdown
Contributor

Description

Temporarily stop scheduling the entire macOS Aspire.Cli.Tests lane so the test-host hangs tracked in #21259 do not continue blocking CI until the hang detector kills the host.

Set this project's RunOnGithubActionsMacOS capability to false and document the restoration condition beside it. Windows/Linux CLI unit tests remain enabled. macOS native CLI archive builds, CLI E2E tests, and unrelated macOS checks are unchanged. This deliberately removes macOS CLI unit coverage; it does not repair or establish the root cause of the hang.

Re-enable the lane after validating a fixed, compatible SDK/runtime. The follow-up toolchain layer is deferred until a viable fixed build and its required publishing packages are available; this change does not pin a daily SDK or modify SDK/feed configuration, test methods, or timeouts.

Related to #21259 as temporary containment only; the issue remains open.

Validation

  • Evaluated real project capabilities and ran the production TestEnumerationRunsheetBuilder target, canonical matrix builder, GitHub matrix expansion, and dependency splitter before/after. The representative three-project matrix changed from 9 to 8 entries, removing exactly Aspire.Cli.Tests / macos-latest; retained entries were identical. CLI Windows/Linux capabilities and RunOnGithubActions remain true, with SkipTests=false. Acquisition/Tray macOS entries and CLI E2E evaluated capabilities are unchanged.
  • Windows enumeration emits unescaped JSON backslashes in testProjectPath. A session-only adapter preserved the raw metadata and normalized only that path field before running the unmodified matrix scripts. No capabilities or repository scripts were overridden. Actual macOS/Linux execution was not performed locally.
  • Ran the production SelectTests tool against the uncommitted project change with its real solution ProjectGraph: exit 0, one affected/selected project (Aspire.Cli.Tests), zero unattributed paths. Existing Windows/Linux consumers still require its test target and runtime-only routes, so the routing map is unchanged.

Repository SDK/dependency setup:

.\restore.cmd -projects tests\Aspire.Cli.Tests\Aspire.Cli.Tests.csproj /p:SkipNativeBuild=true /p:RestoreSources=https://packagefeedproxy.microsoft.io/nuget/v3/index.json

Result: passed, exit 0, using the existing pinned SDK 11.0.100-rc.2.26504.105. The initial tar-based SDK installation failed; the installer's process-local DOTNET_INSTALL_SKIP_TAR=1 ZIP fallback succeeded without changing the pin.

dotnet test --project tests\Aspire.Cli.Tests\Aspire.Cli.Tests.csproj --no-launch-profile --no-restore -- --filter-not-trait "quarantined=true" --filter-not-trait "outerloop=true"

Result: failed, exit 2: 8,781 passed / 2 failed / 121 skipped, 8,904 total. Both failures hit existing five-second test timeouts:

  • TelemetryShutdownTests.Shutdown_HandlesBlockedDeliveryAndStorage(TimedOutCI).
  • AgentInitClientSelectionTests.AgentInit_OpenCodeGlobalDirectoryOverrides_UseExistingJsonConfiguration(XDG_CONFIG_HOME, custom-xdg, custom-xdg/opencode).

These are not claimed to be proven baseline failures; no baseline comparison was run. The initial test attempt inherited a RestoreSources override that replaced fixture-local feeds and was intentionally aborted, not passed. The completed run above unsets that override and uses already-restored repository dependencies.

dotnet restore tests\Infrastructure.Tests\Infrastructure.Tests.csproj --source https://packagefeedproxy.microsoft.io/nuget/v3/index.json
dotnet test --project tests\Infrastructure.Tests\Infrastructure.Tests.csproj --no-launch-profile --no-restore -- --filter-namespace "Infrastructure.Tests.TestTriggerMap" --filter-not-trait "quarantined=true" --filter-not-trait "outerloop=true"

Results: restore passed, exit 0; focused selector suite failed, exit 2: 318 passed / 22 failed. Failures include Bash receiving mangled Windows script paths and exiting 127, and Git-fixture cleanup access-denied errors. No unrelated infrastructure changes were made. git diff --check passed.

No new source-text assertions were added. macOS native builds, CLI E2E execution, and scheduled quarantine/outerloop workflows were not run locally; their unchanged configuration is not presented as execution evidence.

Checklist

  • Is this feature complete?
    • Yes. Ready to ship.
    • No. Follow-up changes expected.
  • Are you including unit tests for the changes and scenario tests if relevant?
    • Yes
    • No
  • Did you add public API?
    • Yes
      • If yes, did you have an API Review for it?
        • Yes
        • No
      • Did you add <remarks /> and <code /> elements on your triple slash comments?
        • Yes
        • No
    • No
  • Does the change make any security assumptions or guarantees?
    • Yes
      • If yes, have you done a threat model and had a security review?
        • Yes
        • No
    • No

Contain the test-host hangs tracked in #21259 until a fixed runtime/toolchain is validated.

Co-authored-by: Copilot App <[email protected]>
@github-actions

Copy link
Copy Markdown
Contributor

🚀 Dogfood this PR with:

⚠️ WARNING: Do not do this without first carefully reviewing the code of this PR to satisfy yourself it is safe.

curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 21385

Or

  • Run remotely in PowerShell:
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 21385"

@github-actions

Copy link
Copy Markdown
Contributor

Tests selector

1 / 100 PR test projects · 0 PR jobs, from 1 changed file.

Selected PR test projects (1 / 100)

Aspire.Cli.Tests

Selected PR jobs (0)

none


How these were chosen — grouped by what changed

🧪 tests/Aspire.Cli.Tests/Aspire.Cli.Tests.csproj (changed test)
→ 1 directly: Aspire.Cli.Tests

Job reasons

none


Selection computed for commit a20c41d.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Failed Windows CLI and selector tests lack baseline comparisons, while the macOS scheduling changes and reduced coverage need validation and human risk assessment.

No open issues 🎉

What changed in this PR

Temporarily disables the macOS CLI unit-test lane to contain recurring test-host hangs tracked in #21259. This removes macOS unit coverage without claiming to fix the underlying hang.

Changes:

  • Sets RunOnGithubActionsMacOS to false for Aspire.Cli.Tests.
  • Adds a tracking link and restoration condition: validate a fixed runtime/toolchain before re-enabling.
  • Leaves Windows/Linux CLI unit tests, macOS native builds, and CLI E2E configuration unchanged.
File Description
tests/​Aspire.Cli.Tests/​Aspire.Cli.Tests.csproj Disables macOS scheduling and documents when to restore it.

Review effort: Balanced

@mitchdenny Mitch Denny (mitchdenny) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving so we can get merging unblocked and then we can come back and try and be more selective or even solve the problem with a workaround until we get .NET 11 with the fix in it.

@mitchdenny
Mitch Denny (mitchdenny) enabled auto-merge (squash) October 29, 2026 00:15
@mitchdenny
Mitch Denny (mitchdenny) merged commit 818da5a into main Oct 29, 2026
53 checks passed
@microsoft-github-policy-service microsoft-github-policy-service Bot added this to the 17.0 milestone Oct 29, 2026
@aspire-repo-bot

Copy link
Copy Markdown
Contributor

✅ No documentation update needed.

docs_optional → test_only (proven false positive on a gating signal).

  • Triggered signal: pr_body_has_cli_flag_mention. Evidence: the PR body contains dotnet test ... --no-launch-profile, which is a test command, not a user-facing Aspire CLI flag.
  • Changed files: the only file is tests/Aspire.Cli.Tests/Aspire.Cli.Tests.csproj, which matches tests/**. This is a temporary disabling of a macOS CI test lane, with no user-facing change.

Mitch Denny (mitchdenny) added a commit that referenced this pull request Oct 29, 2026
Restore the five methods disabled by bd92d7b. PR #21385 now contains the macOS CLI test-host issue at the CI lane level; the underlying runtime issue #21259 remains open.

Co-authored-by: Copilot App <[email protected]>
Copilot-Session: ac380eac-c60d-4f83-9ad8-0416e791cdba
@karolz-ms
Karol Zadora-Przylecki (karolz-ms) deleted the dev/karolz/macos-cli-containment branch October 29, 2026 15:43
Karol Zadora-Przylecki (karolz-ms) pushed a commit that referenced this pull request Oct 29, 2026
## Description

Restore the macOS `Aspire.Cli.Tests` lane disabled by #21385 while
retaining the pinned .NET 11 RC2 toolchain. Aspire's process-heavy CLI
tests are impacted by the stopped-child process-management livelock
described in
[dotnet/runtime#135294](dotnet/runtime#135294).
The upstream fix is merged in
[dotnet/runtime#135323](dotnet/runtime#135323),
but we cannot yet consume a build containing it.

Related to #21259.

### Evidence and workaround

The unmodified suite and a separate parallel process-test control both
hung locally. The test host had stopped children and zombie children,
and a native sample showed the `.NET SigHandler` repeatedly alternating
between `SystemNative_WaitIdAnyExitedNoHangNoWait` and
`SystemNative_WaitPidExitedNoHang`. Externally killing the identified
stopped children released an unrelated `git --version` process start
that had been blocked for approximately 118 seconds. This strongly
connects the reproduced Aspire hang to the upstream mechanism; it does
not establish that every historical CI hang has the same cause. A usable
managed lock-owner dump was not obtained.

Re-enable `RunOnGithubActionsMacOS` and select the existing
`tests/helix/xunit.runner.json` only when building CLI tests on macOS.
That config disables xUnit test-collection parallelism, removing
inter-collection process-management concurrency while retaining all
existing test cases and assertions. Windows/Linux runner settings, macOS
native CLI archives, E2E, other test projects, SDK pins, exclusions, and
timeouts are unchanged.

**This is test containment, not a runtime repair.** Within-test process
races remain possible, and production Aspire CLI processes on the
affected runtime remain potentially exposed. No production incident is
claimed to have been reproduced or fixed. Remove the macOS serialization
override after adopting and validating a runtime containing
dotnet/runtime#135323.

### Validation

Local environment: macOS 26.7.1 (25G241), ARM64; SDK
`11.0.100-rc.2.26504.105`. The test host was observed loading runtime
`11.0.0-rc.2.26504.105` from the repository-local `.dotnet` directory.

Three sequential full-suite runs, with different test-order seeds and no
parallelism command-line override, all passed inside the existing
20-minute CI budget:

| Seed | Passed | Failed | Existing skips | Total | Duration |
|---|---:|---:|---:|---:|---|
| 43 | 8,874 | 0 | 68 | 8,942 | 11m 45.491s |
| 44 | 8,874 | 0 | 68 | 8,942 | 11m 27.924s |
| 45 | 8,874 | 0 | 68 | 8,942 | 14m 22.506s |

`./restore.sh` — passed.

Full-suite command, run for each of seeds `43`, `44`, and `45` — passed
with the results above:

```bash
HOME="$short_home" DOTNET_CLI_HOME="$short_home" \
NUGET_PACKAGES="$package_cache" \
DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1 DOTNET_GENERATE_ASPNET_CERTIFICATE=false \
dotnet test --project tests/Aspire.Cli.Tests/Aspire.Cli.Tests.csproj \
  --no-launch-profile -- --seed "$run" \
  --filter-not-trait "quarantined=true" --filter-not-trait "outerloop=true" \
  --hangdump --hangdump-timeout 2m --hangdump-type Mini --timeout 20m \
  --report-trx --results-directory "$evidence/config-full-$run"
```

`short_home` was a securely created short, canonical `/private/tmp`
directory; `package_cache` retained the existing package cache. This
isolated unrelated user NuGet configuration and avoided macOS
Unix-socket path-length limits. Earlier validation-environment trials
failed or were stopped because of user NuGet configuration, an overlong
isolated-home socket path, or `/tmp` symlink-relative paths; those are
not counted as passes, and no product code or assertions were changed to
accommodate them.

Ten serialized process-heavy repetitions passed (107 passed / 14 skipped
each), as did three expanded process-surface repetitions (211 passed /
17 skipped each). After the final one-file edit, another expanded
process check passed (211 passed / 17 skipped, seed 114). The existing
serialized config selected by the final change is byte-identical to the
candidate used for the full repetitions; the rebuilt output config was
also byte-compared successfully. Discovery display names were unchanged.

```bash
dotnet test --project tests/Infrastructure.Tests/Infrastructure.Tests.csproj \
  --no-launch-profile -- --filter-namespace "Infrastructure.Tests.TestTriggerMap" \
  --filter-not-trait "quarantined=true" --filter-not-trait "outerloop=true"
```

Passed: all 340 selector infrastructure tests. Final selector tracing
attributes the single changed project file to `Aspire.Cli.Tests`, with
no unattributed files. `git diff --check` passed.

Hosted GitHub macOS CI has not yet been validated. Windows/Linux
execution was not rerun on this macOS host. Repeated local success
supports this containment workaround, not a guarantee that the defective
runtime can no longer hang.

## Checklist

- Is this feature complete?
  - [x] Yes. Ready to ship.
  - [ ] No. Follow-up changes expected.
- Are you including unit tests for the changes and scenario tests if
relevant?
  - [ ] Yes
  - [x] No
- Did you add public API?
  - [ ] Yes
    - If yes, did you have an API Review for it?
      - [ ] Yes
      - [ ] No
- Did you add `<remarks />` and `<code />` elements on your triple slash
comments?
      - [ ] Yes
      - [ ] No
  - [x] No
- Does the change make any security assumptions or guarantees?
  - [ ] Yes
    - If yes, have you done a threat model and had a security review?
      - [ ] Yes
      - [ ] No
  - [x] No

Co-authored-by: Copilot App <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants