From c4056e3d6bc2760d1038bbbdc5fc6d82c387efd3 Mon Sep 17 00:00:00 2001 From: ethernet Date: Fri, 18 Sep 2026 15:38:12 -0400 Subject: [PATCH] fix(install-e2e): a native command's stderr is not a failure The windows next-startup step died on its own first line: hermes.exe : hermes: completing source-update dependencies... + FullyQualifiedErrorId : NativeCommandError ##[error]Process completed with exit code 1. prepare_launch reports progress on stderr, and PowerShell turns a native command's stderr into a terminating NativeCommandError under the wrong ErrorActionPreference -- so the heal was killed the moment it announced itself. The --version probe a few lines below already guards this with $ErrorActionPreference = 'Continue' plus 2>&1 |; use the same idiom here, with the preference saved and restored. Verified: pwsh's parser accepts the file. --- tests/install/windows-e2e.ps1 | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/tests/install/windows-e2e.ps1 b/tests/install/windows-e2e.ps1 index da431f1957..9bc1e8de4e 100644 --- a/tests/install/windows-e2e.ps1 +++ b/tests/install/windows-e2e.ps1 @@ -373,8 +373,19 @@ function Test-HermesRuns([string]$Label) { $startupHermes = Get-SourceHermesForStartup $InstallDir $startupLog = Join-Path $WorkRoot 'logs\post-update-startup.log' New-Item -ItemType Directory -Force -Path (Split-Path $startupLog) | Out-Null - & $startupHermes status *> $startupLog - Write-Host " first startup after the update ran (exit $LASTEXITCODE); the checks below assert the launcher it must have published" + # prepare_launch reports its progress on stderr, and a native command's + # stderr becomes a terminating NativeCommandError under the wrong + # preference -- which killed this step before the heal could finish. + # Same idiom the --version probe below already uses. + $prevStartupEap = $ErrorActionPreference + try { + $ErrorActionPreference = 'Continue' + & $startupHermes status 2>&1 | Out-File -Encoding UTF8 $startupLog + $startupExit = $LASTEXITCODE + } finally { + $ErrorActionPreference = $prevStartupEap + } + Write-Host " first startup after the update ran (exit $startupExit); the checks below assert the launcher it must have published" $hermesExe = Get-SourceHermes $InstallDir } & python -B (Join-Path $AssetsDir 'source_driver.py') --root $InstallDir --launcher $hermesExe --desktop $script:ExpectedDesktop