Skip to content

Add aspire stop --wait to wait for resource teardown - #22583

Merged
Adam Ratzman (adamint) merged 6 commits into
mainfrom
sebros/aspire-stop-wait-teardown
Nov 25, 2026
Merged

Adam Ratzman (adamint) merged 6 commits into
mainfrom
sebros/aspire-stop-wait-teardown

Conversation

@sebastienros

@sebastienros Sébastien Ros (sebastienros) commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

Description

aspire stop reported success as soon as the AppHost process exited, but DCP was still removing the instance's containers in the background. A start issued right after could adopt a still-running fixed-name container (WithContainerName(...)), which the old teardown then removed about a minute later and broke every caller. Agents following "stop, then restart" guidance hit this often.

User-facing usage

  • New opt-in aspire stop --wait: returns only after the AppHost's resources (containers, executables, networks) have been torn down. It waits up to 120 seconds by default (--timeout <seconds>, 1 to 4294967, changes this and requires --wait), and reports clearly when it cannot confirm the teardown. The AppHost is stopped in every case:
    • Timeout: error and exit code 17 (WaitTimeout).
    • AppHost too old to support waiting: error and exit code 9 (AppHostIncompatible).
    • Teardown not confirmed: error and exit code 2.
  • Works with --pid, --all, and --force. With --force, persistent-resource cleanup still runs when teardown is unconfirmed. Not allowed with the hidden tray protocol.
  • Default behavior (no --wait) has the same timing as before. After the AppHost exits, stop now prints this message once: ℹ️ Resources may still be stopping in the background. Use --wait to wait until they are torn down.
$ aspire stop --wait --apphost StopWaitRepro.AppHost.csproj --non-interactive
📦 Found running AppHost: .../StopWaitRepro.AppHost.csproj
🛑 Sending stop signal to .../StopWaitRepro.AppHost.csproj...
Waiting for the resources of .../StopWaitRepro.AppHost.csproj to be torn down...
Stopping .../StopWaitRepro.AppHost.csproj...
✅ .../StopWaitRepro.AppHost.csproj stopped successfully.
✅ The resources of .../StopWaitRepro.AppHost.csproj were torn down.
  --wait               Wait until the AppHost's resources, such as containers, are torn down before returning
  --timeout <timeout>  Maximum time in seconds to wait for resources to be torn down (requires --wait) [default: 120]

How it works

The "teardown complete" signal comes from DCP's own cleanup status, not from sleeps:

  • AppHost: StopAsync(StopAppHostRequest { WaitForResourceCleanup = true }) calls the new ApplicationOrchestrator/DcpExecutor.StopAndWaitForResourceCleanupAsync. That uses the existing CleanupResourcesAsync, which waits for DCP to report ResourcesCleanedUp (programs stopped, non-persistent containers deleted). Cleanup failures are reported by DCP itself through its logs, which reach the AppHost via the DCP log stream. The AppHost then responds with ResourcesCleanedUp and stops itself. It stops even if the client cancels the wait.
  • Capability: the AppHost advertises the new stop-resource-cleanup.v1 capability. Older AppHosts don't advertise it; for those, the CLI stops normally and reports that waiting is unsupported.
  • CLI: StopCommand sends the teardown request bounded by --timeout (120 seconds by default), then runs the existing process-exit monitoring and force-kill fallback. It doesn't resend the stop over a connection the AppHost may already have closed.
  • stop --all: with --wait, orphaned AppHosts (whose launching CLI died) go through the same teardown-aware stop instead of the up-front orphan collection, which only waits for process exit. Without --wait, AppHosts stopped by that collection also trigger the background-teardown hint.
  • Docs: docs/specs/cli-backchannel.md and src/Aspire.Cli/README.md are updated.

Starting an instance that is still being torn down is unchanged and out of scope here.

Validation

  • dotnet test --project tests/Aspire.Cli.Tests/Aspire.Cli.Tests.csproj --no-launch-profile -- --filter-class "*.StopCommandTests" --filter-not-trait "quarantined=true" --filter-not-trait "outerloop=true": passed (81/81), including the new --wait tests (success, default, custom and maximum --timeout expiry, invalid and out-of-range --timeout values, unsupported, unconfirmed, --force --wait, and the one-time hint without --wait).
  • dotnet test --project tests/Aspire.Hosting.Tests/Aspire.Hosting.Tests.csproj --no-launch-profile -- --filter-class "*.DcpExecutorTests" --filter-class "*.AuxiliaryBackchannelTests" --filter-class "*.AuxiliaryBackchannelRpcTargetTests" --filter-class "*.ApplicationOrchestratorTests" --filter-not-trait "quarantined=true" --filter-not-trait "outerloop=true": 512 passed, 1 failed. The failure, CanConnectMultipleClientsToAuxiliaryBackchannel, also fails on unmodified main on this machine (an extra socket client), so it is environmental. New tests cover the executor cleanup wait and the end-to-end StopAsync RPC with real DCP.
  • New Docker-backed CLI E2E test StopWaitTests.StopWaitRemovesFixedNameContainerBeforeReturning: starts a fixed-name container, runs stop --wait, checks once (no polling) that the container is gone, then restarts and verifies the container stays up. It passes in CI.
  • Dogfood testing with the PR's CI-built CLI on macOS + Docker: 7 scenarios passed, including stop --wait followed by an immediate restart that stayed healthy for 60 seconds, and an AppHost on stable 17.0.0 getting exit code 9 (report).
  • Full Aspire.Cli.Tests run (same filters): 10595 passed, 8 failed. The failures are in NuGetPackageOperationConfigurationTests, PrebuiltAppHostServerTests and DotNetCliRunnerTests.CandidateRestore_* (NuGet/restore), which this change doesn't touch. I didn't rerun them on main.
  • Manual check with the source-built CLI and an AppHost with two WithContainerName Redis containers on macOS + Docker:
    • Without --wait: reproduced the bug (both containers still Up after "stopped successfully").
    • With --wait: returned after about 4 s, with both containers gone.
    • stop --wait followed immediately by start: the new containers stayed Running/Healthy after 45 s.
    • --pid --wait: containers removed, and the AppHost and launcher processes exited.

Fixes #22510
Part of #22511

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

aspire stop returned once the AppHost process exited, while DCP was still
removing the instance's containers. A start issued right away could adopt
a fixed-name container that was then removed.

- New opt-in --wait option: the CLI asks the AppHost (via the stop RPC,
  gated on the new stop-resource-cleanup.v1 capability) to have DCP clean
  up its resources, waits up to 2 minutes for DCP to confirm, and reports
  timeouts (exit 17), unsupported AppHosts (exit 9) or unconfirmed teardown.
- Without --wait, stop now prints that teardown may continue in the
  background and suggests --wait.

Fixes #22510

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 -- 22583

Or

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

@github-actions

This comment has been minimized.

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.

🟡 Changes recommended

Cleanup can report success while resources remain, and stop --all --wait bypasses teardown verification for orphaned AppHosts, making immediate restart unsafe.

3 open issues
1 file not reviewed
  • src/Aspire.Cli/Resources/StopCommandStrings.Designer.cs: Generated file
What changed in this PR

Adds opt-in aspire stop --wait to coordinate CLI shutdown with DCP resource cleanup, addressing the stop/restart race in #22510. This connects the CLI’s stop command to a new AppHost backchannel capability while preserving default stop timing.

Changes:

  • Adds cleanup waiting, timeout and compatibility reporting, plus a one-time hint when stopping without --wait.
  • Extends the backchannel and hosting orchestrator to request and report resource cleanup.
  • Adds focused tests, documentation, and localization entries.
File Description
tests/​Aspire.Hosting.TestUtilities/​Utils/​TestDcpExecutor.cs Implements cleanup waiting in the test executor.
tests/​Aspire.Hosting.Tests/​Dcp/​TestKubernetesService.cs Tracks cleanup requests.
tests/​Aspire.Hosting.Tests/​Dcp/​DcpExecutorTests.cs Tests cleanup confirmation and cancellation outcomes.
tests/​Aspire.Hosting.Tests/​Backchannel/​AuxiliaryBackchannelTests.cs Tests cleanup RPC and capability advertisement.
tests/​Aspire.Cli.Tests/​TestServices/​TestAppHostAuxiliaryBackchannel.cs Adds configurable cleanup responses and call tracking.
tests/​Aspire.Cli.Tests/​Commands/​TerminalCommandTests.cs Forwards new backchannel members in the test wrapper.
tests/​Aspire.Cli.Tests/​Commands/​StopCommandTests.cs Covers wait outcomes, force cleanup, and the default hint.
src/​Aspire.Hosting/​Orchestrator/​ApplicationOrchestrator.cs Delegates cleanup-aware shutdown to DCP.
src/​Aspire.Hosting/​Dcp/​IDcpExecutor.cs Defines the cleanup-wait operation.
src/​Aspire.Hosting/​Dcp/​DcpExecutor.cs Shares shutdown logic and reports cleanup confirmation.
src/​Aspire.Hosting/​Backchannel/​BackchannelDataTypes.cs Adds cleanup capability, request, and response fields.
src/​Aspire.Hosting/​Backchannel/​AuxiliaryBackchannelRpcTarget.cs Handles cleanup-aware stop requests.
src/​Aspire.Cli/​Resources/​xlf/​StopCommandStrings.zh-Hant.xlf Adds pending Traditional Chinese localization entries.
src/​Aspire.Cli/​Resources/​xlf/​StopCommandStrings.zh-Hans.xlf Adds pending Simplified Chinese localization entries.
src/​Aspire.Cli/​Resources/​xlf/​StopCommandStrings.tr.xlf Adds pending Turkish localization entries.
src/​Aspire.Cli/​Resources/​xlf/​StopCommandStrings.ru.xlf Adds pending Russian localization entries.
src/​Aspire.Cli/​Resources/​xlf/​StopCommandStrings.pt-BR.xlf Adds pending Brazilian Portuguese localization entries.
src/​Aspire.Cli/​Resources/​xlf/​StopCommandStrings.pl.xlf Adds pending Polish localization entries.
src/​Aspire.Cli/​Resources/​xlf/​StopCommandStrings.ko.xlf Adds pending Korean localization entries.
src/​Aspire.Cli/​Resources/​xlf/​StopCommandStrings.ja.xlf Adds pending Japanese localization entries.
src/​Aspire.Cli/​Resources/​xlf/​StopCommandStrings.it.xlf Adds pending Italian localization entries.
src/​Aspire.Cli/​Resources/​xlf/​StopCommandStrings.fr.xlf Adds pending French localization entries.
src/​Aspire.Cli/​Resources/​xlf/​StopCommandStrings.es.xlf Adds pending Spanish localization entries.
src/​Aspire.Cli/​Resources/​xlf/​StopCommandStrings.de.xlf Adds pending German localization entries.
src/​Aspire.Cli/​Resources/​xlf/​StopCommandStrings.cs.xlf Adds pending Czech localization entries.
src/​Aspire.Cli/​Resources/​StopCommandStrings.resx Defines wait help and cleanup status messages.
src/​Aspire.Cli/​Resources/​StopCommandStrings.Designer.cs Exposes the new resource strings.
src/​Aspire.Cli/​README.md Documents wait usage and exit codes.
src/​Aspire.Cli/​Commands/​StopCommand.TrayProtocol.cs Rejects --wait in tray protocol requests.
src/​Aspire.Cli/​Commands/​StopCommand.cs Implements wait handling and cleanup outcome reporting.
src/​Aspire.Cli/​Backchannel/​IAppHostAuxiliaryBackchannel.cs Defines client-side cleanup capability and operation.
src/​Aspire.Cli/​Backchannel/​AppHostAuxiliaryBackchannel.cs Sends cleanup-aware stop requests.
docs/​specs/​cli-backchannel.md Documents cleanup capability compatibility.

Review effort: Balanced

Comment thread src/Aspire.Cli/Commands/StopCommand.cs Resolved
Comment thread src/Aspire.Hosting/Dcp/DcpExecutor.cs Resolved
Comment thread src/Aspire.Cli/Commands/StopCommand.cs Resolved
@github-actions

Copy link
Copy Markdown
Contributor

Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt.

- stop --all --wait routes orphaned AppHosts through the teardown-aware
  stop instead of the process-exit-only orphan collector.
- After DCP reports cleanup complete, verify no application objects remain
  before reporting resources as torn down, since DCP reports completion even
  when cleanup fails.
- Add a Docker-backed CLI E2E test for stop --wait with a fixed-name container.

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

This comment has been minimized.

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.

🟡 Changes recommended

Orphan-only stop --all runs can omit the teardown warning, and container-removal assertions can falsely pass when docker ps fails.

1 open issue
1 previously missed issue

In code that hasn't changed since last review

Medium severity Count collected orphan AppHosts for teardown warnings

src/​Aspire.Cli/​Commands/​StopCommand.cs:595

When stop --all stops only orphaned AppHosts, CollectAsync removes their sockets before the subsequent scan, so none reach CountStoppedWithoutTeardownWait. The counter remains zero and the new teardown warning is omitted even though those AppHosts' resources may still be stopping. Include successfully collected orphans in _appHostsStoppedWithoutTeardownWait so this path also emits the one-time warning.

3 resolved since last review
1 file not reviewed
  • src/Aspire.Cli/Resources/StopCommandStrings.Designer.cs: Generated file

Review effort: Balanced

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

When stop --all finds only orphaned AppHosts, it omits the background-teardown warning because collected hosts are not added to the count of hosts stopped without waiting for teardown.

No open issues 🎉

1 previously missed issue

In code that hasn't changed since last review

Medium severity Include collected AppHosts in the teardown-wait warning count

src/​Aspire.Cli/​Commands/​StopCommand.cs:595

When stop --all finds only orphaned AppHosts, CollectAsync stops them and deletes their sockets before the next scan. None then reach CountStoppedWithoutTeardownWait, so the command returns successfully without the new background-teardown warning, even though collection only waits for process exit. Please add the collected count to _appHostsStoppedWithoutTeardownWait so this path also emits the one-time --wait hint.

1 resolved since last review
1 file not reviewed
  • src/Aspire.Cli/Resources/StopCommandStrings.Designer.cs: Generated file

Review effort: Balanced

@github-actions

This comment has been minimized.

@github-actions

Copy link
Copy Markdown
Contributor

Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt.

@sebastienros

Copy link
Copy Markdown
Contributor Author

Addressed the finding from this review in f0e5558: without --wait, stop --all now adds orphaned AppHosts it collected to the count of AppHosts stopped without waiting for teardown, so the one-time --wait hint is shown when only orphaned AppHosts were running. Covered by StopCommand_All_ReportsThatResourceTeardownMayContinueForCollectedOrphanedAppHost.

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.

🟢 Approval recommended

The review identifies no active issues with the opt-in cleanup-wait change.

No open issues 🎉

1 file not reviewed
  • src/Aspire.Cli/Resources/StopCommandStrings.Designer.cs: Generated file

Review effort: Balanced

@github-actions

This comment has been minimized.

@github-actions

Copy link
Copy Markdown
Contributor

Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt.

@sebastienros

Copy link
Copy Markdown
Contributor Author

PR Testing Report

PR Information

Artifact Version Verification

  • Expected Commit: f0e5558
  • Installed Version: 17.1.0-pr.22583.gf0e5558b (dogfood install via get-aspire-cli-pr.sh 22583 --install-path <tmp> --skip-path --skip-extension)
  • Status: ✅ Verified

Changes Analyzed

Change Categories

  • CLI changes: new aspire stop --wait option, a background-teardown hint after the default stop, and --all --wait handling for orphaned AppHosts (src/Aspire.Cli/Commands/StopCommand.cs, backchannel, resources).
  • Hosting changes: the stop request can now ask the AppHost to wait for resource cleanup, behind a new stop-resource-cleanup.v1 capability. DcpExecutor checks for leftover DCP objects after cleanup.
  • Dashboard changes
  • Template changes
  • Client/Component changes
  • VS Code extension changes
  • Test changes: CLI unit tests, hosting tests, and the new StopWaitTests E2E (passes in CI).
  • CI infrastructure changes

Test Scenarios Executed

All scenarios used a C# file-based AppHost (apphost.cs, the issue's setup) created with aspire new aspire-empty from the PR hive. It ran two redis:7 containers with fixed names (WithContainerName).

Scenario 1: Default aspire stop (no --wait)

Coverage Type: Happy path. Status: ✅ Passed

  • Exited 0, printed stopped successfully, then: ℹ️ Resources may still be stopping in the background. Use --wait to wait until they are torn down.
  • docker ps right after the command returned still showed both containers Up (the original bug, now surfaced to the user). They were gone 15s later.

Scenario 2: aspire stop --wait, then immediate aspire start (the issue's repro)

Coverage Type: Happy path / regression. Status: ✅ Passed

  • stop --wait exited 0 in about 4s. It printed Waiting for the resources of apphost.cs to be torn down..., stopped successfully, and The resources of apphost.cs were torn down.
  • docker ps -a --filter name=prtest-22583 right after the command returned: empty.
  • After an immediate aspire start, both containers were still Up 59 seconds 60s later, and aspire describe showed cache and cache2 Running/Healthy. No adoption-then-removal.

Scenario 3: aspire stop --wait --pid <AppHost PID>

Coverage Type: Happy path. Status: ✅ Passed

  • Exited 0 with the (PID 7559) identifier and the "torn down" message. The containers were absent right away, and the AppHost process had exited.

Scenario 4: aspire stop --all --wait

Coverage Type: Happy path. Status: ✅ Passed

  • Exited 0 with the "torn down" message and no background hint. The containers were absent right away.

Unhappy: stop --wait --pid 999999 (not an AppHost)

Status: ✅ Passed. Expected: exit 7, nothing stopped.

  • ❌ No running AppHost with PID 999999 was found. No AppHosts were stopped., exit 7. The running containers were untouched.

Unhappy: stop --wait with nothing running

Status: ✅ Passed. Expected: exit 0, informational message, no hint.

  • ℹ️ No AppHost is currently running for 'apphost.cs'..., exit 0.

Unhappy: stop --wait against an AppHost on stable Aspire.Hosting 17.0.0 (no capability)

Status: ✅ Passed. Expected: exit 9, clear message, AppHost still stopped.

  • Printed stopped successfully, then ❌ apphost.cs does not support waiting for its resources to be torn down, so they may still be stopping in the background. Update the AppHost to a newer Aspire version to use --wait., exit 9.
  • The AppHost process had exited, and its container was cleaned up in the background.

CI

  • All 353 checks pass on f0e5558, including Cli.EndToEnd-StopWaitTests and Cli.EndToEnd-StopForceTests.

Summary

Scenario Status Notes
1. Default stop ✅ Passed Hint shown; containers still up right after return
2. stop --wait + immediate restart ✅ Passed Containers gone on return; restart healthy after 60s
3. stop --wait --pid ✅ Passed
4. stop --all --wait ✅ Passed
Unhappy: unknown --pid ✅ Passed Exit 7, nothing stopped
Unhappy: nothing running ✅ Passed Exit 0, no hint
Unhappy: stable 17.0.0 AppHost ✅ Passed Exit 9, AppHost stopped

Overall Result

✅ PR VERIFIED

Recommendations

  • None blocking. stop --all shows a shortened path (StopWaitApp/apphost.cs) where the single-AppHost stop shows apphost.cs; this is existing display behavior, not new in this PR.

@github-actions

This comment has been minimized.

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.

🟡 Changes recommended

The timeout validation accepts values beyond the timer’s supported range, causing an exception before any stop request is sent and leaving the AppHost running.

1 open issue
1 file not reviewed
  • src/Aspire.Cli/Resources/StopCommandStrings.Designer.cs: Generated file

Review effort: Balanced

Comment thread src/Aspire.Cli/Commands/StopCommand.cs Resolved
@github-actions

Copy link
Copy Markdown
Contributor

Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt.

@github-actions

Copy link
Copy Markdown
Contributor

Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt.

- Reject --timeout values above the CancellationTokenSource timer limit
  (4294967 seconds) before discovery.
- Remove the post-cleanup DCP object-count check; DCP reports cleanup
  failures itself.

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

Copy link
Copy Markdown
Contributor

Tests selector

55 / 101 PR test projects · 4 PR jobs, from 32 changed files.

Selected PR test projects (55 / 101)

Aspire.Cli.EndToEnd.Tests, Aspire.Cli.Tests, Aspire.Hosting.Analyzers.Tests, Aspire.Hosting.Azure.EntraId.Tests, Aspire.Hosting.Azure.Kubernetes.Tests, Aspire.Hosting.Azure.Kusto.Tests, Aspire.Hosting.Azure.Provisioning.Tests, Aspire.Hosting.Azure.Tests, Aspire.Hosting.Blazor.Tests, Aspire.Hosting.Browsers.Tests, Aspire.Hosting.CodeGeneration.Go.Tests, Aspire.Hosting.CodeGeneration.Java.Tests, Aspire.Hosting.CodeGeneration.Python.Tests, Aspire.Hosting.CodeGeneration.Rust.Tests, Aspire.Hosting.CodeGeneration.TypeScript.Tests, Aspire.Hosting.Containers.Tests, Aspire.Hosting.DevTunnels.Tests, Aspire.Hosting.Docker.Tests, Aspire.Hosting.Dotnet.Tests, Aspire.Hosting.DotnetTool.Tests, Aspire.Hosting.EntityFrameworkCore.Tests, Aspire.Hosting.Foundry.Tests, Aspire.Hosting.Garnet.Tests, Aspire.Hosting.Go.Tests, Aspire.Hosting.Java.Tests, Aspire.Hosting.JavaScript.Tests, Aspire.Hosting.Kafka.Tests, Aspire.Hosting.Keycloak.Tests, Aspire.Hosting.Kubernetes.Tests, Aspire.Hosting.Maui.Tests, Aspire.Hosting.Milvus.Tests, Aspire.Hosting.MongoDB.Tests, Aspire.Hosting.MySql.Tests, Aspire.Hosting.Native.Core.Tests, Aspire.Hosting.Nats.Tests, Aspire.Hosting.OpenAI.Tests, Aspire.Hosting.Oracle.Tests, Aspire.Hosting.Orleans.Tests, Aspire.Hosting.PostgreSQL.Tests, Aspire.Hosting.Python.Tests, Aspire.Hosting.Qdrant.Tests, Aspire.Hosting.RabbitMQ.Tests, Aspire.Hosting.Radius.Tests, Aspire.Hosting.Redis.Tests, Aspire.Hosting.RemoteHost.Tests, Aspire.Hosting.Rust.Tests, Aspire.Hosting.Seq.Tests, Aspire.Hosting.SqlServer.Tests, Aspire.Hosting.Testing.Tests, Aspire.Hosting.Tests, Aspire.Hosting.Valkey.Tests, Aspire.Hosting.Yarp.Tests, Aspire.Playground.Tests, Aspire.Templates.Tests, Infrastructure.Tests

Selected PR jobs (4)

cli-starter-validation, extension-e2e, polyglot, typescript-api-compat


How these were chosen — grouped by what changed

⚠️ 34 of the 55 selected test projects come from a single change — tests/Aspire.Hosting.TestUtilities/Utils/TestDcpExecutor.cs.

🧪 tests/Aspire.Hosting.TestUtilities/Utils/TestDcpExecutor.cs (changed test)
→ 34 via the project graph

show 34

Aspire.Hosting.Azure.EntraId.Tests, Aspire.Hosting.Azure.Kubernetes.Tests, Aspire.Hosting.Azure.Kusto.Tests, Aspire.Hosting.Browsers.Tests, Aspire.Hosting.Containers.Tests, Aspire.Hosting.DevTunnels.Tests, Aspire.Hosting.Docker.Tests, Aspire.Hosting.DotnetTool.Tests, Aspire.Hosting.EntityFrameworkCore.Tests, Aspire.Hosting.Foundry.Tests, Aspire.Hosting.Garnet.Tests, Aspire.Hosting.Go.Tests, Aspire.Hosting.Java.Tests, Aspire.Hosting.JavaScript.Tests, Aspire.Hosting.Kafka.Tests, Aspire.Hosting.Keycloak.Tests, Aspire.Hosting.Kubernetes.Tests, Aspire.Hosting.Milvus.Tests, Aspire.Hosting.MongoDB.Tests, Aspire.Hosting.MySql.Tests, Aspire.Hosting.Nats.Tests, Aspire.Hosting.OpenAI.Tests, Aspire.Hosting.Oracle.Tests, Aspire.Hosting.Orleans.Tests, Aspire.Hosting.PostgreSQL.Tests, Aspire.Hosting.Python.Tests, Aspire.Hosting.Qdrant.Tests, Aspire.Hosting.RabbitMQ.Tests, Aspire.Hosting.Redis.Tests, Aspire.Hosting.Rust.Tests, Aspire.Hosting.Seq.Tests, Aspire.Hosting.SqlServer.Tests, Aspire.Hosting.Valkey.Tests, Aspire.Hosting.Yarp.Tests

🔧 src/Aspire.Hosting/Backchannel/AuxiliaryBackchannelRpcTarget.cs (changed source)
→ 12 via the project graph: Aspire.Hosting.Analyzers.Tests (2 hops), Aspire.Hosting.Azure.Provisioning.Tests (3 hops), Aspire.Hosting.Azure.Tests, Aspire.Hosting.CodeGeneration.Go.Tests, Aspire.Hosting.CodeGeneration.Java.Tests, Aspire.Hosting.CodeGeneration.Python.Tests, Aspire.Hosting.CodeGeneration.Rust.Tests, Aspire.Hosting.CodeGeneration.TypeScript.Tests, Aspire.Hosting.Maui.Tests, Aspire.Hosting.RemoteHost.Tests, Aspire.Hosting.Testing.Tests (2 hops), Aspire.Playground.Tests

🧪 tests/Aspire.Hosting.Tests/Backchannel/AuxiliaryBackchannelTests.cs (changed test)
→ 1 directly: Aspire.Hosting.Tests
→ 3 via the project graph: Aspire.Hosting.Blazor.Tests, Aspire.Hosting.Dotnet.Tests, Aspire.Hosting.Radius.Tests

📦 affected project Aspire.Hosting.Dotnet
→ 2 tests: Aspire.Cli.EndToEnd.Tests, Aspire.Templates.Tests

📦 affected project Aspire.Cli
→ 1 test: Aspire.Cli.EndToEnd.Tests

🔧 src/Aspire.Cli/Resources/StopCommandStrings.Designer.cs (changed source)
→ 1 via the project graph: Aspire.Cli.EndToEnd.Tests

🔧 src/Aspire.Cli/Resources/StopCommandStrings.resx (changed source)
→ 1 directly: Infrastructure.Tests

🔧 src/Aspire.Hosting/Backchannel/BackchannelDataTypes.cs (changed source)
→ 1 via the project graph: Aspire.Hosting.Native.Core.Tests

🧪 tests/Aspire.Cli.EndToEnd.Tests/StopWaitTests.cs (changed test)
→ 1 directly: Aspire.Cli.EndToEnd.Tests

🧪 tests/Aspire.Cli.Tests/Commands/StopCommandTests.cs (changed test)
→ 1 directly: Aspire.Cli.Tests

🧪 tests/Aspire.Cli.Tests/Commands/TerminalCommandTests.cs (changed test)
→ 1 directly: Aspire.Cli.Tests

🧪 tests/Aspire.Cli.Tests/TestServices/TestAppHostAuxiliaryBackchannel.cs (changed test)
→ 1 directly: Aspire.Cli.Tests

🧪 tests/Aspire.Hosting.Tests/Dcp/DcpExecutorTests.cs (changed test)
→ 1 directly: Aspire.Hosting.Tests

🧪 tests/Aspire.Hosting.Tests/Dcp/TestKubernetesService.cs (changed test)
→ 1 directly: Aspire.Hosting.Tests

Job reasons

Job Triggered by
cli-starter-validation affected project Aspire.Cli
extension-e2e • src/Aspire.Cli/Backchannel/AppHostAuxiliaryBackchannel.cs, src/Aspire.Cli/Backchannel/IAppHostAuxiliaryBackchannel.cs, src/Aspire.Cli/Commands/StopCommand.TrayProtocol.cs, src/Aspire.Cli/Commands/StopCommand.cs, src/Aspire.Cli/Resources/StopCommandStrings.Designer.cs, src/Aspire.Cli/Resources/StopCommandStrings.resx, src/Aspire.Cli/Resources/xlf/StopCommandStrings.cs.xlf, src/Aspire.Cli/Resources/xlf/StopCommandStrings.de.xlf, src/Aspire.Cli/Resources/xlf/StopCommandStrings.es.xlf, src/Aspire.Cli/Resources/xlf/StopCommandStrings.fr.xlf, src/Aspire.Cli/Resources/xlf/StopCommandStrings.it.xlf, src/Aspire.Cli/Resources/xlf/StopCommandStrings.ja.xlf, src/Aspire.Cli/Resources/xlf/StopCommandStrings.ko.xlf, src/Aspire.Cli/Resources/xlf/StopCommandStrings.pl.xlf, src/Aspire.Cli/Resources/xlf/StopCommandStrings.pt-BR.xlf, src/Aspire.Cli/Resources/xlf/StopCommandStrings.ru.xlf, src/Aspire.Cli/Resources/xlf/StopCommandStrings.tr.xlf, src/Aspire.Cli/Resources/xlf/StopCommandStrings.zh-Hans.xlf, src/Aspire.Cli/Resources/xlf/StopCommandStrings.zh-Hant.xlf, src/Aspire.Hosting/Backchannel/AuxiliaryBackchannelRpcTarget.cs, src/Aspire.Hosting/Backchannel/BackchannelDataTypes.cs, src/Aspire.Hosting/Dcp/DcpExecutor.cs, src/Aspire.Hosting/Dcp/IDcpExecutor.cs, src/Aspire.Hosting/Orchestrator/ApplicationOrchestrator.cs
• affected project Aspire.Cli
polyglot • affected project Aspire.Cli
• affected project Aspire.Hosting.Azure.Provisioning.KeyVault
typescript-api-compat affected project Aspire.Cli

Selection computed for commit 30ebf72.

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

Human assessment is needed because the new tests do not cover cancellation during an in-flight teardown, leaving uncertainty about whether the AppHost stops after cleanup begins.

No open issues 🎉

1 resolved since last review
1 file not reviewed
  • src/Aspire.Cli/Resources/StopCommandStrings.Designer.cs: Generated file

Review effort: Balanced

@github-actions

Copy link
Copy Markdown
Contributor

Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt.

@adamint
Adam Ratzman (adamint) merged commit 1e842ec into main Nov 25, 2026
723 of 726 checks passed
@microsoft-github-policy-service microsoft-github-policy-service Bot added this to the 17.1 milestone Nov 25, 2026
@aspire-repo-bot

Copy link
Copy Markdown
Contributor

Pull request created: #2248

Generated by PR Documentation Check · copilot · auto (Claude Sonnet 5.5) · ~28 AIC · ⌖ ~10 AIC · ⊞ 7.6K

@aspire-repo-bot

Copy link
Copy Markdown
Contributor

📝 Documentation has been drafted in microsoft/aspire.dev#2248 targeting release/17.1.

Updated aspire-stop.mdx to document --wait and --timeout, exit codes (17/9/2), and the new default-behavior message. Signals: cli_option_added (--wait Option in StopCommand.cs), cli_command_file_changed, cli_resource_strings_changed (StopCommandStrings.resx), pr_body_has_cli_flag_mention, pr_body_has_user_facing_section.

Note

This draft PR needs human review before merging.

Comment thread src/Aspire.Cli/README.md Resolved
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.

aspire stop returns before teardown; a start right after it adopts containers that are then removed

5 participants