Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions internal/components/engram/download.go
Original file line number Diff line number Diff line change
Expand Up @@ -605,6 +605,7 @@ if ($procs) {
Write-Output "WARNING: $($remaining.Count) engram process(es) could not be stopped (access denied or still running). The upgrade may fail if the file is still locked."
}
}
exit 0
`
}

Expand Down
6 changes: 6 additions & 0 deletions internal/components/engram/download_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1280,4 +1280,10 @@ func TestEngramStopScriptIsDefensive(t *testing.T) {
if strings.Contains(script, "Stop-Process -Force -ErrorAction Stop") {
t.Errorf("stop script must not use -ErrorAction Stop on Stop-Process (reintroduces issue #815/#850)\nscript:\n%s", script)
}

// The clean/no-process path must report success explicitly, regardless of any
// PowerShell status left behind by defensive no-op commands.
if !strings.HasSuffix(strings.TrimSpace(script), "exit 0") {
t.Errorf("stop script must explicitly exit 0 on the clean/no-process path\nscript:\n%s", script)
}
}
Loading