Run recovery handoffs for the host target

This commit is contained in:
2026-11-04 00:52:04 +00:00
parent d8ec9389e0
commit bd693ca31b
3 changed files with 12 additions and 6 deletions

View File

@@ -256,7 +256,8 @@ func TestColdGoToolRecoverySurvivesLauncherExit(t *testing.T) {
}
// Execute from another directory after the original driver and the
// API-only launcher's temporary files are gone.
evidence, err := publish.LoadEvidence(outputLineValue(text, "publication record saved: "))
originalRecord := outputLineValue(text, "publication record saved: ")
evidence, err := publish.LoadEvidence(originalRecord)
if err != nil {
t.Fatal(err)
}
@@ -277,10 +278,12 @@ func TestColdGoToolRecoverySurvivesLauncherExit(t *testing.T) {
}
selected := command
if scenario.record != "" {
selected += " --record " + shellQuote(scenario.record)
selected = strings.Replace(selected, shellQuote(originalRecord), shellQuote(scenario.record), 1)
}
recovery := exec.Command("sh", "-c", selected)
recovery.Dir = t.TempDir()
foreignOS, foreignArch := foreignTarget()
recovery.Env = setEnvironment(setEnvironment(os.Environ(), "GOOS", foreignOS), "GOARCH", foreignArch)
recovered, err := recovery.CombinedOutput()
if scenario.status == 0 && err != nil || scenario.status != 0 && (!errors.As(err, &exitError) || exitError.ExitCode() != scenario.status) {
t.Fatalf("recovery status want %d: %v: %s", scenario.status, err, recovered)