Skip to content

Fix TypeScript deadlock repro E2E test - #17701

Merged
James Newton-King (JamesNK) merged 1 commit into
mainfrom
use-terminalrun-deadlock-test
May 29, 2026
Merged

James Newton-King (JamesNK) merged 1 commit into
mainfrom
use-terminalrun-deadlock-test

Conversation

@JamesNK

@JamesNK James Newton-King (JamesNK) commented May 29, 2026 •

Copy link
Copy Markdown
Member

Summary

Refactors TypeScriptAppHostRunDoesNotDeadlockWhenLazyOptionsInvokeAsyncCallback (added in #17575) to use the TerminalRun pattern via CliE2ETestHelpers.StartRun, replacing the manual pendingRun / testBodyFailed / try-catch-finally cleanup block.

Changes

  • Replaced manual terminal.RunAsync + try/catch/finally with await using var terminalRun = CliE2ETestHelpers.StartRun(...) which handles diagnostics capture, terminal exit, and awaiting the run automatically via DisposeAsync.
  • Replaced RunCommandFailFastAsync (which doesn't exist) with RunCommandAsync to fix compilation.
  • Test logic is unchanged — only the lifecycle/cleanup boilerplate is removed.

This makes the test consistent with all other CLI E2E tests in the project.

Fixes #17684

Copilot AI review requested due to automatic review settings May 29, 2026 22:28
@github-actions

github-actions Bot commented May 29, 2026 •

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

Or

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

@JamesNK
James Newton-King (JamesNK) force-pushed the use-terminalrun-deadlock-test branch from d96bee7 to 1d2f683 Compare May 29, 2026 22:29

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.

Pull request overview

This PR refactors the TypeScript AppHost async-callback deadlock regression test to use the shared CLI E2E TerminalRun lifecycle pattern instead of bespoke terminal-run cleanup logic.

Changes:

  • Replaces manual pendingRun / testBodyFailed / finally cleanup with CliE2ETestHelpers.StartRun.
  • Keeps the existing repro setup, restore/build, aspire start, and aspire stop flow unchanged.

@JamesNK James Newton-King (JamesNK) changed the title Use TerminalRun in TypeScript deadlock repro E2E test Fix TypeScript deadlock repro E2E test May 29, 2026
@JamesNK

Copy link
Copy Markdown
Member Author

/backport to release/13.4

@github-actions

Copy link
Copy Markdown
Contributor

Started backporting to release/13.4 (link to workflow run)

@JamesNK
James Newton-King (JamesNK) enabled auto-merge (squash) May 29, 2026 23:15
@JamesNK
James Newton-King (JamesNK) merged commit 948607f into main May 29, 2026
616 of 619 checks passed
@JamesNK
James Newton-King (JamesNK) deleted the use-terminalrun-deadlock-test branch May 29, 2026 23:17
@microsoft-github-policy-service microsoft-github-policy-service Bot added this to the 13.5 milestone May 29, 2026
@github-actions

Copy link
Copy Markdown
Contributor

❓ CLI E2E Tests unknown — 110 passed, 0 failed, 2 unknown (commit 1d2f683)

View all recordings
Status Test Recording Job Artifacts
✅ AddPackageInteractiveWhileAppHostRunningDetached Recording #78601936595 Logs
✅ AddPackageWhileAppHostRunningDetached Recording #78601936595 Logs
✅ AgentCommands_AllHelpOutputs_AreCorrect Recording #78601936389 Logs
✅ AgentInitCommand_DefaultSelection_InstallsDefaultSkills Recording #78601936389 Logs
✅ AgentInitCommand_MigratesDeprecatedConfig Recording #78601936389 Logs
✅ AgentInitCommand_NonInteractive_BundleOnlySkillsBeyondCliCatalog_AreInstallable Recording #78601936389 Logs
✅ AgentMcpListStructuredLogsReturnsLogsFromStarterApp Recording #78601936935 Logs
✅ AgentMcpListStructuredLogsReturnsLogsFromStarterApp_DevLocalhost Recording #78601936935 Logs
✅ AgentMcpListStructuredLogsReturnsLogsFromStarterApp_Isolated Recording #78601936935 Logs
✅ AllPublishMethodsBuildDockerImages Recording #78601936920 Logs
✅ AspireAddAndStartWorkAgainstLegacyAppHostTs Recording #78601937028 Logs
✅ AspireAddPackageVersionToDirectoryPackagesProps Recording #78601936571 Logs
✅ AspireInitSingleFileAppHostRunsViaDotnetRunAppHost Recording #78601936487 Logs
✅ AspireInitWithExistingAppHostDirRecreatesMissingNuGetConfigAndPreservesFiles Recording #78601936747 Logs
❔ AspireInitWithSolutionFileGeneratesAppHostThatBuildsAgainstChannelHive Recording #78601936747 Logs
✅ AspireStartUpdatesStaleTypeScriptAppHostPath Recording #78601936990 Logs
✅ AspireUpdateRemovesAppHostPackageVersionFromDirectoryPackagesProps Recording #78601936571 Logs
✅ AspireUpdateRemovesOrphanAppHostPackageVersionWhenSdkAlreadyCurrent Recording #78601936571 Logs
✅ Banner_DisplayedOnFirstRun Recording #78601936961 Logs
✅ Banner_DisplayedWithExplicitFlag Recording #78601936961 Logs
✅ Banner_NotDisplayedWithNoLogoFlag Recording #78601936961 Logs
✅ CertificatesClean_RemovesCertificates Recording #78601936575 Logs
✅ CertificatesTrust_WithNoCert_CreatesAndTrustsCertificate Recording #78601936575 Logs
✅ CertificatesTrust_WithUntrustedCert_TrustsCertificate Recording #78601936575 Logs
✅ ConfigSetGet_CreatesNestedJsonFormat Recording #78601937154 Logs
✅ CreateAndRunAspireStarterProject Recording #78601936854 Logs
✅ CreateAndRunAspireStarterProjectWithBundle Recording #78601936675 Logs
✅ CreateAndRunEmptyAppHostProject Recording #78601936579 Logs
✅ CreateAndRunJavaEmptyAppHostProject Recording #78601937024 Logs
✅ CreateAndRunJsReactProject Recording #78601937116 Logs
✅ CreateAndRunPolyglotAppHostWithDevLocalhostUrls Recording #78601936854 Logs
✅ CreateAndRunPythonReactProject Recording #78601936653 Logs
✅ CreateAndRunTypeScriptEmptyAppHostProject Recording #78601936986 Logs
✅ CreateAndRunTypeScriptStarterProject Recording #78601936890 Logs
✅ CreateJavaAppHostWithViteApp Recording #78601936435 Logs
✅ CreateTypeScriptAppHostWithViteApp_AllowsGuestAppPackageManagerToDiffer Recording #78601937038 Logs
✅ CreateTypeScriptAppHostWithViteApp_UsesConfiguredToolchain Recording #78601937038 Logs
✅ DashboardRunWithAgentMcpListTracesReturnsNoTraces Recording #78601936558 Logs
✅ DashboardRunWithAgentMcpListTracesReturnsNoTraces_DevLocalhost Recording #78601936558 Logs
✅ DashboardRunWithOtelTracesReturnsNoTraces Recording #78601936558 Logs
✅ DashboardRunWithOtelTracesReturnsNoTraces_DevLocalhost Recording #78601936558 Logs
✅ DeployK8sBasicApiService Recording #78601936869 Logs
✅ DeployK8sWithExternalHelmChart Recording #78601936682 Logs
✅ DeployK8sWithGarnet Recording #78601936634 Logs
✅ DeployK8sWithMongoDB Recording #78601937019 Logs
✅ DeployK8sWithMySql Recording #78601936866 Logs
✅ DeployK8sWithPostgres Recording #78601936534 Logs
✅ DeployK8sWithRabbitMQ Recording #78601936845 Logs
✅ DeployK8sWithRedis Recording #78601937062 Logs
✅ DeployK8sWithSqlServer Recording #78601936922 Logs
✅ DeployK8sWithValkey Recording #78601936604 Logs
✅ DeployTypeScriptAppToKubernetes Recording #78601936851 Logs
✅ DescribeCommandResolvesReplicaNames Recording #78601937089 Logs
✅ DescribeCommandShowsRunningResources Recording #78601937089 Logs
✅ DetachFormatJsonProducesValidJson Recording #78601936716 Logs
✅ DetachFormatJsonProducesValidJsonWhenRestartingExistingInstance Recording #78601936716 Logs
✅ DoPublishAndDeployListStepsWork Recording #78601937040 Logs
✅ DocsCommand_RendersInteractiveMarkdownFromLocalSource Recording #78601937121 Logs
✅ DoctorCommand_DetectsDeprecatedAgentConfig Recording #78601936389 Logs
✅ DoctorCommand_TypeScriptAppHostReportsMissingConfiguredToolchain Recording #78601936721 Logs
✅ DoctorCommand_WithSslCertDir_ShowsTrusted Recording #78601936721 Logs
✅ DoctorCommand_WithoutSslCertDir_ShowsPartiallyTrusted Recording #78601936721 Logs
✅ GatewayWithoutExternalEndpoint_FailsPublishWithGuidance Recording #78601937031 Logs
✅ GeneratedAspireDevScript_StartsWatchMode_WithConfiguredToolchain Recording #78601937038 Logs
✅ GlobalMigration_HandlesCommentsAndTrailingCommas Recording #78601937154 Logs
✅ GlobalMigration_HandlesMalformedLegacyJson Recording #78601937154 Logs
✅ GlobalMigration_PreservesAllValueTypes Recording #78601937154 Logs
✅ GlobalMigration_SkipsWhenNewConfigExists Recording #78601937154 Logs
✅ GlobalSettings_MigratedFromLegacyFormat Recording #78601937154 Logs
✅ IngressWithoutExternalEndpoint_FailsPublishWithGuidance Recording #78601937031 Logs
✅ InitTypeScriptAppHost_AugmentsExistingViteRepoInWorkspaceSubdirectory Recording #78601937038 Logs
✅ InteractiveCSharpInitCreatesExpectedFiles Recording #78601936715 Logs
✅ InvalidAppHostPathWithComments_IsHealedOnRun Recording #78601936674 Logs
✅ JavaScriptHostingApisRunFromTypeScriptAppHost Recording #78601936920 Logs
✅ LatestCliCanStartStableChannelAppHost Recording #78601936854 Logs
✅ LatestCliCanStartStableChannelTypeScriptAppHost Recording #78601936854 Logs
✅ LegacySettingsMigration_AdjustsRelativeAppHostPath Recording #78601936990 Logs
✅ LogsCommandShowsResourceLogs Recording #78601937037 Logs
✅ OtelLogsReturnsStructuredLogsFromStarterApp Recording #78601936921 Logs
✅ OtelLogsReturnsStructuredLogsFromStarterAppIsolated Recording #78601936921 Logs
✅ PsCommandListsRunningAppHost Recording #78601936834 Logs
✅ PsFormatJsonOutputsOnlyJsonToStdout Recording #78601936834 Logs
✅ PublishJavaScriptPatternsGeneratesExpectedDockerComposeArtifacts Recording #78601936607 Logs
✅ PublishWithConfigureEnvFileUpdatesEnvOutput Recording #78601936607 Logs
✅ PublishWithDockerComposeServiceCallbackSucceeds Recording #78601936607 Logs
✅ PublishWithoutOutputPathUsesAppHostDirectoryDefault Recording #78601936607 Logs
✅ ResourceCommand_FailedExecution_DisplaysAppHostLogPathAndLogContainsEntries Recording #78601936722 Logs
✅ ResourceCommand_SetAndDeleteParameterUpdatesDescribeOutput Recording #78601936722 Logs
✅ RestoreGeneratesSdkFiles Recording #78601936963 Logs
✅ RestoreGeneratesSdkFiles_WithConfiguredToolchain Recording #78601936842 Logs
✅ RestoreRefreshesGeneratedSdkAfterAddingIntegration Recording #78601936842 Logs
✅ RestoreSupportsConfigOnlyHelperPackageAndCrossPackageTypes Recording #78601936806 Logs
✅ RunFromParentDirectory_UsesExistingConfigNearAppHost Recording #78601936442 Logs
✅ RunReportsSyntaxErrorsForDotNetAppHost Recording #78601937022 Logs
✅ RunReportsSyntaxErrorsForTypeScriptAppHost Recording #78601937022 Logs
✅ SecretCrudOnDotNetAppHost Recording #78601936906 Logs
✅ SecretCrudOnTypeScriptAppHost Recording #78601936590 Logs
✅ StagingChannel_ConfigureAndVerifySettings_ThenSwitchChannels Recording #78601936770 Logs
✅ StartAndWaitForTypeScriptSqlServerAppHostWithNativeAssets Recording #78601937023 Logs
✅ StartReportsSyntaxErrorsForDotNetAppHost Recording #78601937022 Logs
✅ StartReportsSyntaxErrorsForTypeScriptAppHost Recording #78601937022 Logs
✅ StopAllAppHostsFromAppHostDirectory Recording #78601936746 Logs
✅ StopJavaPolyglotAppHostUsingApphostDirectory Recording #78601940447 Logs
✅ StopNonInteractiveSingleAppHost Recording #78601936746 Logs
✅ StopTypeScriptPolyglotAppHostUsingApphostDirectory Recording #78601936731 Logs
✅ StopWithNoRunningAppHostExitsSuccessfully Recording #78601936595 Logs
✅ TypeScriptAppHostRunDoesNotDeadlockWhenLazyOptionsInvokeAsyncCallback Recording #78601936986 Logs
✅ UnAwaitedChainsCompileWithAutoResolvePromises Recording #78601936842 Logs
❔ UpdateProjectChannelToStable_CSharpEmptyAppHost_PreservesAspireConfigChannel Recording #78601936585 Logs
✅ UpdateProjectChannelToStable_CSharpSingleFileInit_PreservesAspireConfigChannel Recording #78601936585 Logs
✅ UpdateProjectChannelToStable_TypeScriptSingleFileInit_PreservesAspireConfigChannel Recording #78601936585 Logs
✅ UpdateProjectChannelToStable_TypeScript_PreviewsStablePackagesAndPreservesChannel Recording #78601936585 Logs

📹 Recordings uploaded automatically from CI run #26665457550

@aspire-repo-bot

Copy link
Copy Markdown
Contributor

✅ No documentation update needed.

docs_optional → test_only: No documentation update is needed. This PR refactors a single CLI E2E test (TypeScriptAppHostRunDoesNotDeadlockWhenLazyOptionsInvokeAsyncCallback) to use the TerminalRun pattern — test logic is unchanged. No signals triggered (signal_count = 0), and only_test_or_build_changes = true. All changed files match tests/**.

Adam Ratzman (adamint) added a commit to adamint/aspire that referenced this pull request May 29, 2026
Pulls in microsoft#17701 (Fix TypeScript deadlock repro E2E test) so PR
GitHub Actions can complete. Main has been broken for PR events
since microsoft#17575 added a test calling RunCommandFailFastAsync which
microsoft#17588 renamed to RunCommandAsync. microsoft#17701 updates the call sites.

No infra changes from this branch are affected by this merge.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

main is red: RunCommandFailFastAsync used but undefined in TypeScriptEmptyAppHostTemplateTests (introduced by #17575)

3 participants