Extend AppHost debug startup timeout from VS Code#18353
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 18353Or
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 18353" |
There was a problem hiding this comment.
Pull request overview
This PR fixes issue #18021, where a VS Code extension debug session was killed after ~2 minutes when the developer paused on a breakpoint before builder.Build(). The parent Aspire CLI's default AppHost startup timeout (ASPIRE_CLI_START_TIMEOUT, ~120s) would elapse while the AppHost was paused, terminating the session. The fix has the extension inject a very long default startup timeout (86400 = 24h) only for extension-managed debug launches, while leaving run sessions and explicitly configured timeouts untouched.
Changes:
- Add
ASPIRE_CLI_START_TIMEOUTto the extension'sEnvironmentVariablesenum. - In
AspireTerminalProvider.createEnvironment, setASPIRE_CLI_START_TIMEOUT='86400'for debug sessions (noDebug === false) unless the value is already present in the environment. - Add unit tests covering debug (sets timeout), run (no timeout), and explicit-override (preserved) cases, with proper env-var save/restore in setup/teardown.
Show a summary per file
| File | Description |
|---|---|
extension/src/utils/environment.ts |
Adds the ASPIRE_CLI_START_TIMEOUT enum member so the timeout key is referenced consistently. |
extension/src/utils/AspireTerminalProvider.ts |
Sets the long default startup timeout for extension-managed debug sessions, respecting any explicit value. |
extension/src/test/aspireTerminalProvider.test.ts |
Adds tests for the new behavior with env-var isolation in setup/teardown. |
Notes:
- The precedence logic is correct:
envis seeded fromprocess.env, so an explicitly configuredASPIRE_CLI_START_TIMEOUTis preserved (verified by the test at lines 586–598). - The
noDebug === falsecheck matches the existing convention in this method (lines 282–283) for distinguishing Debug vs NoDebug sessions, and the value is consumed by the CLI'sCliConfigNames.AppHostStartupTimeoutas integer seconds. - One optional nit was raised about documenting the
'86400'magic number, consistent with the surrounding WHY-commented code.
Copilot's findings
- Files reviewed: 3/3 changed files
- Comments generated: 1
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt. |
|
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 <223556219+Copilot@users.noreply.github.com>
|
Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt. |
Redact resource command values from hidden CLI spawn diagnostics and merge caller-provided environment variables case-insensitively on Windows so launch configuration overrides win over extension defaults. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Read the configured startup timeout case-insensitively on Windows so diagnostics reflect the child process environment after launch configuration overrides are merged. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
(automated comment) Validation/evidence update for current head
Focused local E2E was attempted, but local fixture restore failed before the scenario with NU1507 package-source mapping warning-as-error from the local NuGet source configuration. CI has the strongest real Extension Host proof for this path. |
Description
Sets a long default
ASPIRE_CLI_START_TIMEOUTfor VS Code extension-managed AppHost debug sessions so pausing on a breakpoint beforebuilder.Build()does not let the parent Aspire CLI hit its normal startup timeout and terminate the debug session.The default only applies to extension-managed debug launches. Extension-managed run sessions keep the normal CLI timeout, and an explicitly configured
ASPIRE_CLI_START_TIMEOUTstill wins, including case-insensitive Windows env overrides.This also aligns the parent CLI's AppHost backchannel wait with a larger configured AppHost startup timeout. That keeps the extension-launched AppHost path from timing out the backchannel before the configured startup timeout expires.
Follow-up review fixes:
--delimiter so resource command argument values, including secret prompt values, are not persisted in extension logs.Fixes #18021
Validation:
./restore.shdotnet test --project tests/Aspire.Cli.Tests/Aspire.Cli.Tests.csproj --no-launch-profile -- --filter-class "*.DotNetCliRunnerTests" --filter-not-trait "quarantined=true" --filter-not-trait "outerloop=true"(63 passed)cd extension && ./build.shcd extension && corepack yarn run compile-testscd extension && corepack yarn run compile && corepack yarn run lintcd extension && ./node_modules/.bin/vscode-test --config .vscode-test-short.mjs --grep "spawnCliProcess tests"with short--user-data-dir(5 passed; temporary config removed)cd extension && ./node_modules/.bin/vscode-test --config .vscode-test-short.mjswith short--user-data-dir(full VS Code unit suite exited 0; temporary config removed)debugStartupTimeoutE2E was attempted, but local fixture restore was blocked before the scenario by NU1507 package-source mapping warning-as-error from the local NuGet source configuration.a783cccaa36d44965115821828818ebd66569cc2: VS Code extension E2Edebug-startup-timeoutLinux and Windows shards passed. Linux diagnostics include an mp4 recording; both shards showASPIRE_CLI_START_TIMEOUT=86400and a ~65s pre-builder.Build()delay completing without timeout. The first full CI attempt hit aDoctorCommand_TypeScriptAppHostReportsMissingConfiguredToolchain(toolchain: "yarn")timeout inCli.EndToEnd-DoctorCommandTests; rerunning failed jobs passed and the full CI run is now green.Review panel:
reviewing-aspire-architecture), no blocking findingscode-reviewguidance, no blocking findings after fixesChecklist
<remarks />and<code />elements on your triple slash comments?