Skip to content

Add opt-in volume cleanup to aspire stop - #20195

Merged
Karol Zadora-Przylecki (karolz-ms) merged 2 commits into
mainfrom
danegsta-aspire-stop-volumes
Sep 18, 2026
Merged

Karol Zadora-Przylecki (karolz-ms) merged 2 commits into
mainfrom
danegsta-aspire-stop-volumes

Conversation

@danegsta

Copy link
Copy Markdown
Member

Description

aspire stop --force can clean up persistent containers and networks, but there was no supported way to also remove persistent volumes created for the AppHost. This adds explicit, opt-in volume cleanup while preserving volumes by default.

Users can pass --volumes together with --force. Aspire forwards the request to dcp cleanup --volumes, and Aspire.Hosting now creates DCP ContainerVolume resources for named mounts so DCP can track ownership. Container creation waits for those volumes to become ready, shared named volumes are deduplicated, and anonymous volumes and bind mounts are unchanged. Volumes that existed before the AppHost started are adopted for mounting but are not recorded as DCP-owned, so cleanup leaves them intact.

Non-bundle .NET AppHosts older than Aspire.Hosting 13.6 receive a compatibility warning because they do not create the DCP volume ownership records required for cleanup.

User-facing usage

Preserve volumes while removing other persistent resources:

aspire stop --force

Also remove persistent volumes created by Aspire:

aspire stop --force --volumes

The new option is shown in command help as:

--volumes  Also remove persistent volumes created by Aspire (requires --force)

Validation included the complete StopCommandTests and WithVolumeTests classes, a container-runtime test verifying the DCP volume reaches Ready, and a CLI end-to-end scenario covering default preservation, opt-in deletion, and adoption and preservation of a pre-existing volume.

Fixes #19569

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

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@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 -- 20195

Or

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

@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

Container creation proceeds after the volume-readiness wait times out, even when volumes remain unready.

Get a fresh assessment by requesting another Copilot review.

Pull request overview

Adds opt-in persistent-volume deletion to aspire stop --force while preserving volumes by default.

Changes:

  • Adds and validates --volumes, forwarding it to DCP cleanup.
  • Registers named volumes as DCP resources and coordinates container startup.
  • Adds unit, runtime, E2E, and localization coverage.
File summaries
File Description
tests/Aspire.Hosting.Tests/WithVolumeTests.cs Tests named-volume preparation and deduplication.
tests/Aspire.Hosting.Tests/DistributedApplicationTests.cs Verifies DCP volume readiness.
tests/Aspire.Cli.Tests/Commands/StopCommandTests.cs Tests CLI validation, forwarding, and warnings.
tests/Aspire.Cli.EndToEnd.Tests/StopForceTests.cs Covers volume preservation, deletion, and adoption.
src/Aspire.Hosting/Dcp/DcpNameGenerator.cs Generates stable DCP volume identifiers.
src/Aspire.Hosting/Dcp/DcpExecutor.cs Creates volumes before containers.
src/Aspire.Hosting/Dcp/ContainerCreator.cs Produces DCP resources for named volumes.
src/Aspire.Cli/Commands/StopCommand.cs Implements the --volumes option.
src/Aspire.Cli/Commands/DcpWorkloadCleanupService.cs Forwards volume cleanup to DCP.
src/Aspire.Cli/Resources/StopCommandStrings.resx Adds user-facing CLI strings.
src/Aspire.Cli/Resources/StopCommandStrings.Designer.cs Exposes generated resource properties.
src/Aspire.Cli/Resources/xlf/StopCommandStrings.cs.xlf Updates Czech localization resources.
src/Aspire.Cli/Resources/xlf/StopCommandStrings.de.xlf Updates German localization resources.
src/Aspire.Cli/Resources/xlf/StopCommandStrings.es.xlf Updates Spanish localization resources.
src/Aspire.Cli/Resources/xlf/StopCommandStrings.fr.xlf Updates French localization resources.
src/Aspire.Cli/Resources/xlf/StopCommandStrings.it.xlf Updates Italian localization resources.
src/Aspire.Cli/Resources/xlf/StopCommandStrings.ja.xlf Updates Japanese localization resources.
src/Aspire.Cli/Resources/xlf/StopCommandStrings.ko.xlf Updates Korean localization resources.
src/Aspire.Cli/Resources/xlf/StopCommandStrings.pl.xlf Updates Polish localization resources.
src/Aspire.Cli/Resources/xlf/StopCommandStrings.pt-BR.xlf Updates Portuguese localization resources.
src/Aspire.Cli/Resources/xlf/StopCommandStrings.ru.xlf Updates Russian localization resources.
src/Aspire.Cli/Resources/xlf/StopCommandStrings.tr.xlf Updates Turkish localization resources.
src/Aspire.Cli/Resources/xlf/StopCommandStrings.zh-Hans.xlf Updates Simplified Chinese resources.
src/Aspire.Cli/Resources/xlf/StopCommandStrings.zh-Hant.xlf Updates Traditional Chinese resources.
Review details

Files not reviewed (1)

  • src/Aspire.Cli/Resources/StopCommandStrings.Designer.cs: Generated file
  • Files reviewed: 23/24 changed files
  • Comments generated: 1
  • Review effort level: Balanced

Comment thread src/Aspire.Hosting/Dcp/DcpExecutor.cs Outdated
@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.

@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.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@github-actions

Copy link
Copy Markdown
Contributor

Tests selector

51 / 99 PR test projects · 4 PR jobs, from 25 changed files.

Selected PR test projects (51 / 99)

Aspire.Cli.EndToEnd.Tests, Aspire.Cli.Tests, Aspire.Hosting.Analyzers.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.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

Selected PR jobs (4)

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


How these were chosen — grouped by what changed

⚠️ 45 of the 51 selected test projects come from a single change — src/Aspire.Hosting/Dcp/ContainerCreator.cs.

🔧 src/Aspire.Hosting/Dcp/ContainerCreator.cs (changed source)
45 via the project graph

show 45

Aspire.Hosting.Analyzers.Tests (2 hops), Aspire.Hosting.Azure.Kubernetes.Tests (2 hops), Aspire.Hosting.Azure.Kusto.Tests (2 hops), Aspire.Hosting.Azure.Provisioning.Tests (3 hops), Aspire.Hosting.Azure.Tests, Aspire.Hosting.Browsers.Tests (2 hops), 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 (2 hops), Aspire.Hosting.DevTunnels.Tests (2 hops), Aspire.Hosting.Docker.Tests (2 hops), Aspire.Hosting.DotnetTool.Tests (2 hops), Aspire.Hosting.EntityFrameworkCore.Tests (2 hops), Aspire.Hosting.Foundry.Tests (2 hops), Aspire.Hosting.Garnet.Tests (2 hops), Aspire.Hosting.Go.Tests (2 hops), Aspire.Hosting.Java.Tests (2 hops), Aspire.Hosting.JavaScript.Tests (2 hops), Aspire.Hosting.Kafka.Tests (2 hops), Aspire.Hosting.Keycloak.Tests (2 hops), Aspire.Hosting.Kubernetes.Tests (2 hops), Aspire.Hosting.Maui.Tests, Aspire.Hosting.Milvus.Tests (2 hops), Aspire.Hosting.MongoDB.Tests (2 hops), Aspire.Hosting.MySql.Tests (2 hops), Aspire.Hosting.Nats.Tests (2 hops), Aspire.Hosting.OpenAI.Tests (2 hops), Aspire.Hosting.Oracle.Tests (2 hops), Aspire.Hosting.Orleans.Tests (2 hops), Aspire.Hosting.PostgreSQL.Tests (2 hops), Aspire.Hosting.Python.Tests (2 hops), Aspire.Hosting.Qdrant.Tests (2 hops), Aspire.Hosting.RabbitMQ.Tests (2 hops), Aspire.Hosting.Redis.Tests (2 hops), Aspire.Hosting.RemoteHost.Tests, Aspire.Hosting.Rust.Tests (2 hops), Aspire.Hosting.Seq.Tests (2 hops), Aspire.Hosting.SqlServer.Tests (2 hops), Aspire.Hosting.Testing.Tests (2 hops), Aspire.Hosting.Valkey.Tests (2 hops), Aspire.Hosting.Yarp.Tests (2 hops), Aspire.Playground.Tests

🧪 tests/Aspire.Hosting.Tests/Dcp/DcpExecutorTests.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.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

🧪 tests/Aspire.Cli.EndToEnd.Tests/StopForceTests.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.Hosting.Tests/DistributedApplicationTests.cs (changed test)
1 directly: Aspire.Hosting.Tests

🧪 tests/Aspire.Hosting.Tests/WithVolumeTests.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/Commands/DcpWorkloadCleanupService.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/Dcp/ContainerCreator.cs, src/Aspire.Hosting/Dcp/DcpExecutor.cs, src/Aspire.Hosting/Dcp/DcpNameGenerator.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 6650f9b.

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

The supported DCP minimum still includes versions that cannot record volume ownership, causing requested cleanup to silently preserve volumes.

Review details

Files not reviewed (1)

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

Suppressed comments (1)

Previously missed (1) — in code that hasn't changed since the last review.

src/Aspire.Hosting/Dcp/ContainerCreator.cs:144

  • This now relies on DCP's workload ownership records, but DcpVersion.MinimumVersionInclusive still permits DCP 0.23.3. DCP 0.25.13 and earlier create this persistent volume without recording ownership, so an otherwise supported 13.6 AppHost using an overridden older DCP will later run stop --force --volumes successfully while leaving the Aspire-created volume behind. Require DCP 0.26.0+ (where volume ownership/cleanup was added), or explicitly gate this feature on that capability.
  • Files reviewed: 24/25 changed files
  • Comments generated: 0 new
  • Review effort level: 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.

@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.

@danegsta

Copy link
Copy Markdown
Member Author

PR Testing Report

PR Information

Artifact Version Verification

  • Expected Commit: 6650f9babbf30440cb84258697a3cdea0d58eeca
  • Installed CLI: /workspace/.aspire/dogfood/pr-20195/bin/aspire
  • Installed Version: 13.6.0-pr.20195.g6650f9ba
  • PR Package Hive: /workspace/.aspire/hives/pr-20195/packages
  • Status: ✅ Verified

The installed dogfood CLI version contains the PR head's short commit SHA, 6650f9ba.

Changes Analyzed

Change Categories

  • CLI changes: adds and validates aspire stop --volumes, then forwards the option to DCP cleanup
  • Hosting changes: creates DCP ownership records for named container volumes and waits for them to become ready
  • Localization changes: adds localized stop-command option and validation text
  • Test changes: CLI unit/E2E and Hosting preparation/runtime/readiness coverage
  • Dashboard changes
  • Client/component changes
  • Template changes
  • VS Code extension changes
  • CI infrastructure changes

Files Changed

  • src/Aspire.Cli/Commands/DcpWorkloadCleanupService.cs
  • src/Aspire.Cli/Commands/StopCommand.cs
  • src/Aspire.Cli/Resources/StopCommandStrings.resx
  • src/Aspire.Cli/Resources/StopCommandStrings.Designer.cs
  • src/Aspire.Cli/Resources/xlf/StopCommandStrings.*.xlf
  • src/Aspire.Hosting/Dcp/ContainerCreator.cs
  • src/Aspire.Hosting/Dcp/DcpExecutor.cs
  • src/Aspire.Hosting/Dcp/DcpNameGenerator.cs
  • tests/Aspire.Cli.EndToEnd.Tests/StopForceTests.cs
  • tests/Aspire.Cli.Tests/Commands/StopCommandTests.cs
  • tests/Aspire.Hosting.Tests/Dcp/DcpExecutorTests.cs
  • tests/Aspire.Hosting.Tests/DistributedApplicationTests.cs
  • tests/Aspire.Hosting.Tests/WithVolumeTests.cs

Test Environment

  • Repo container runner on Docker Desktop for macOS
  • Ubuntu 24.04 Linux ARM64 container
  • Docker client/server 29.8.0
  • .NET SDK 10.0.100 installed into the retained test workspace because the runner image does not include an SDK
  • Fresh aspire-empty C# AppHost generated for every functional scenario
  • Templates resolved explicitly from the PR package hive with the installed PR version

Test Scenarios Executed

Scenario 1: Artifact baseline smoke

Objective: Verify the matching PR CLI can generate, start, and stop a fresh empty C# AppHost.

Coverage Type: Baseline happy path
Status: ✅ Passed

Steps:

  1. Ran aspire new aspire-empty with explicit PR source/version, --language csharp, --localhost-tld false, and --suppress-agent-init.
  2. Started the generated file-based AppHost with the installed PR CLI.
  3. Stopped the running AppHost by explicit --apphost path.

Evidence:

  • scenarios/run-1789682854/scenario-1-baseline/new.log
  • scenarios/run-1789682854/scenario-1-baseline/start.log
  • scenarios/run-1789682854/scenario-1-baseline/stop.log

Scenario 2: Default force cleanup preserves a DCP-owned volume

Objective: Verify existing aspire stop --force behavior remains non-destructive for named volumes.

Coverage Type: Compatibility/boundary
Status: ✅ Passed

Steps:

  1. Generated a fresh AppHost with a persistent Redis container and a named volume.
  2. Confirmed the volume did not exist before startup.
  3. Started the AppHost and waited for the persistent container.
  4. Confirmed DCP created the volume with a com.microsoft.developer.usvc-dev.volumeOwnershipToken label.
  5. Ran aspire stop --force without --volumes.
  6. Confirmed the persistent container was removed and the DCP-owned volume still existed.
  7. Removed the preserved volume explicitly as test cleanup.

Evidence:

  • scenarios/run-1789682854/scenario-2-default-preserve/volume-before-stop.json
  • scenarios/run-1789682854/scenario-2-default-preserve/stop.log
  • scenarios/run-1789682854/scenario-2-default-preserve/volume-after-stop.json
  • scenarios/run-1789682854/scenario-2-default-preserve/manual-cleanup.log

Scenario 3: Opt-in cleanup removes a DCP-owned volume

Objective: Verify aspire stop --force --volumes forwards the cleanup request and deletes a volume created and owned by DCP.

Coverage Type: Feature happy path
Status: ✅ Passed

Steps:

  1. Generated a fresh AppHost with a persistent Redis container and a named volume.
  2. Confirmed the volume did not exist before startup.
  3. Started the AppHost and confirmed the DCP-created volume existed.
  4. Ran aspire stop --force --volumes.
  5. Confirmed the persistent container and DCP-owned volume were both removed.

Evidence:

  • scenarios/run-1789682854/scenario-3-opt-in-delete/volume-before-stop.json
  • scenarios/run-1789682854/scenario-3-opt-in-delete/stop.log

Scenario 4: Pre-existing volume is adopted and preserved

Objective: Verify DCP mounts a pre-existing named Docker volume but does not claim ownership or remove it during opt-in cleanup.

Coverage Type: Ownership boundary
Status: ✅ Passed

Steps:

  1. Generated a fresh AppHost referencing a named volume.
  2. Created that Docker volume before starting the AppHost.
  3. Started the AppHost and confirmed the container mounted the exact volume at /preexisting.
  4. Ran aspire stop --force --volumes.
  5. Confirmed the persistent container was removed while the pre-existing volume remained.
  6. Removed the pre-existing volume explicitly as test cleanup.

Evidence:

  • scenarios/run-1789682854/scenario-4-preexisting/create-volume.log
  • scenarios/run-1789682854/scenario-4-preexisting/mounts.txt
  • scenarios/run-1789682854/scenario-4-preexisting/stop.log
  • scenarios/run-1789682854/scenario-4-preexisting/volume-after-stop.json
  • scenarios/run-1789682854/scenario-4-preexisting/manual-cleanup.log

Observed mount:

pr20195-adopt-volume-1789682854 /preexisting

Scenario 5: --volumes requires --force

Objective: Verify the new destructive option cannot be used without explicit force cleanup.

Coverage Type: Unhappy path
Status: ✅ Passed

Steps:

  1. Ran aspire stop --volumes.
  2. Confirmed the command returned non-zero exit code 1.
  3. Confirmed the output contained The --volumes option requires the --force option.

Evidence:

  • scenarios/run-1789682854/scenario-5-invalid-options/output.log
  • scenarios/run-1789682854/scenario-5-invalid-options/exit-code.txt

Expected Unhappy-Path Outcome: A clear validation error before any AppHost selection or DCP cleanup attempt.

Scenario 6: Unready DCP volume states block container creation

Objective: Verify the review fix rejects unknown, pending, and runtime-unhealthy volume states while allowing ready volumes.

Coverage Type: Source regression/boundary
Status: ✅ Passed

Command:

dotnet test --project tests/Aspire.Hosting.Tests/Aspire.Hosting.Tests.csproj --no-launch-profile -- --filter-method "*.EnsureContainerVolumesReady_ThrowsWhenVolumeIsNotReady" --filter-method "*.EnsureContainerVolumesReady_AllowsReadyVolumes" --filter-not-trait "quarantined=true" --filter-not-trait "outerloop=true"

Result: 4 passed, 0 failed, 0 skipped.

Evidence:

  • scenario-6-unready-volume-tests.log

Test Harness Notes

  • The first template attempt prompted for the aspire-empty language in non-interactive mode. The test command was corrected to pass --language csharp.
  • The repo container runner image does not include the .NET SDK. The first AppHost start therefore failed before exercising the PR with C# AppHost requires .NET SDK version 10.0.100 or later. Detected: (not found). Installing .NET SDK 10.0.100 in the isolated test workspace resolved the environment prerequisite.
  • These were test harness/environment setup failures, not failures in the PR artifact.

Summary

Scenario Status Notes
Artifact baseline smoke ✅ Passed PR CLI generated, started, and stopped a fresh AppHost
Default force cleanup ✅ Passed DCP-owned volume preserved without --volumes
Opt-in volume cleanup ✅ Passed DCP-owned volume removed with --force --volumes
Pre-existing volume adoption ✅ Passed Exact volume mounted and preserved during cleanup
Invalid option combination ✅ Passed Rejected before cleanup with exit code 1
Unready volume states ✅ Passed 4 focused source tests passed

Overall Result

✅ PR VERIFIED

The PR artifact matches the current head commit and all approved scenarios passed. The behavior preserves volumes by default, deletes only DCP-owned volumes when explicitly requested, preserves adopted pre-existing volumes, and rejects unsafe option usage. No test containers or volumes remain after the run.

@karolz-ms
Karol Zadora-Przylecki (karolz-ms) merged commit 2f175f2 into main Sep 18, 2026
1976 of 1994 checks passed
@karolz-ms
Karol Zadora-Przylecki (karolz-ms) deleted the danegsta-aspire-stop-volumes branch September 18, 2026 16:08
@microsoft-github-policy-service microsoft-github-policy-service Bot added this to the 13.6 milestone Sep 18, 2026
@github-actions

Copy link
Copy Markdown
Contributor

⚠️ CI Failure Analysis: Possible Flaky Test(s)

The CI build failed due to test failure(s) that appear unrelated to the PR changes. These may be flaky tests.

Suspected flaky test(s):

  • Aspire.Acquisition.Tests.Scripts.PRScriptShellTests.BooleanFlags_AreAccepted(flag: "--verbose") in job Tests / No-package tests (regular, Aspire.Acquisition.Tests, Acquisition, Acquisition, tests/Aspire.Acqui...) / Acquisition (ubuntu-latest)
    • Error: Aspire.Templates.Tests.ToolCommandException : Expected 0 exit code but got 1: bash "/home/runner/work/aspire/aspire/eng/scripts/get-aspire-cli-pr.sh" 12345 --dry-run --skip-path --verbose
      Standard Output:
      �[0;31mError: GitHub CLI (gh) command failed: /home/runner/work/aspire/aspire/eng/scripts/get-aspire-cli-pr.sh: /tmp/aspire-test-5zRCqG/mock-bin/gh: /bin/bash: bad interpreter: Text file busy�[0m
    • Stack Trace (first frames):
at Aspire.Templates.Tests.CommandResult.EnsureExitCode(Int32 expectedExitCode, String messagePrefix, Boolean suppressOutput) in /_/tests/Shared/TemplatesTesting/CommandResult.cs:line 36
   at Aspire.Templates.Tests.CommandResult.EnsureSuccessful(String messagePrefix, Boolean suppressOutput) in /_/tests/Shared/TemplatesTesting/CommandResult.cs:line 20
   at Aspire.Acquisition.Tests.Scripts.PRScriptShellTests.BooleanFlags_AreAccepted(String flag) in /_/tests/Aspire.Acquisition.Tests/Scripts/PRScriptShellTests.cs:line 344
--- End of stack trace from previous location ---
  • Why likely flaky: This is a known race condition where the test's mock 'gh' binary is invoked while still being written to disk, producing an OS-level 'Text file busy' error. The PR does not modify any acquisition scripts or test infrastructure, so this is unrelated to the PR's changes.
  • Aspire.Hosting.Azure.Tests.AzureServiceBusExtensionsTests.AzureServiceBusEmulatorResourceGeneratesConfigJsonOnlyChangedProperties in job Tests / No-package tests (regular, Aspire.Hosting.Azure.Tests, Hosting.Azure, Hosting.Azure, tests/Aspire...) / Hosting.Azure (ubuntu-latest)
    • Error: System.Threading.Tasks.TaskCanceledException : A task was canceled.
    • Stack Trace (first frames):
at Microsoft.Extensions.Hosting.Internal.Host.ForeachService[T](IEnumerable`1 services, CancellationToken token, Boolean concurrent, Boolean abortOnFirstException, List`1 exceptions, Func`3 operation)
   at Microsoft.Extensions.Hosting.Internal.Host.StopAsync(CancellationToken cancellationToken)
   at Aspire.Hosting.DistributedApplication.StopAsync(CancellationToken cancellationToken) in /_/src/Aspire.Hosting/DistributedApplication.cs:line 497
   at Aspire.Hosting.Azure.Tests.AzureServiceBusExtensionsTests.AzureServiceBusEmulatorResourceGeneratesConfigJsonOnlyChangedProperties() in /home/runner/work/aspire/aspire/tests/Aspire.Hosting.Azure.Tests/AzureServiceBusExtensionsTests.cs:line 499
--- End of stack trace from previous location ---
  • Why likely flaky: The test times out during host shutdown (DistributedApplication.StopAsync), an emulator resource teardown timing issue not tied to the PR's Aspire.Cli/Aspire.Hosting.Dcp changes, matching a previously seen recurring failure.
  • Aspire Blazor browser debugger E2E hits a managed breakpoint for standalone in job Tests / Run VS Code extension E2E tests / VS Code extension E2E (Windows, browser-debugger)
    • Error: Failed to apply E2E control revision 1789748850923: Error: Timed out after 295215ms waiting for pwa-msedge child session for Blazor WASM root 'b9d16957-43fb-4034-8c30-edca49e755c3'. Last error: . State: {"debugSessions":[{"id":"85cc8d71-ceb3-4c11-a291-e76974e434ab","type":"monovsdbg_wasm","name":"Wasm Managed Debugger"...}]}
    • Stack Trace (first frames):
Error: Failed to apply E2E control revision 1789748850923: Error: Timed out after 295215ms waiting for pwa-msedge child session for Blazor WASM root 'b9d16957-43fb-4034-8c30-edca49e755c3'. Last error: <none>.
  • Why likely flaky: This is a timeout waiting for the Blazor WASM debug session's child pwa-msedge session to attach, unrelated to the PR's Aspire.Cli/Aspire.Hosting.Dcp changes. Matches a previously identified recurring flaky pattern in the browser-debugger E2E shard.

Suggested actions:

  • Re-run the failed CI jobs to confirm if the failure is intermittent
  • If the test continues to fail, consider quarantining it using /quarantine-test <test name> <issue URL>
  • Search existing issues to see if this test is already known to be flaky

You can re-run the failed jobs from the workflow run page.

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 --force not wiping volumes

3 participants