Reconcile concurrent archive validation commits

This commit is contained in:
rcourtman
2026-07-09 23:34:14 +01:00
2 changed files with 23 additions and 15 deletions
-15
View File
@@ -168,21 +168,6 @@ func TestRunDownloadedBinarySelfTestPropagatesFailureWithoutTokenArg(t *testing.
}
}
func TestRestartProcess(t *testing.T) {
orig := execFn
t.Cleanup(func() { execFn = orig })
execFn = func(string, []string, []string) error { return nil }
if err := restartProcess("/bin/true"); err != nil {
t.Fatalf("expected nil error, got %v", err)
}
execFn = func(string, []string, []string) error { return errors.New("boom") }
if err := restartProcess("/bin/false"); err == nil {
t.Fatalf("expected error")
}
}
func TestDetermineArchOverrides(t *testing.T) {
origOS, origArch, origUname := runtimeGOOS, runtimeGOARCH, unameCommand
t.Cleanup(func() {
+23
View File
@@ -0,0 +1,23 @@
//go:build !windows
package agentupdate
import (
"errors"
"testing"
)
func TestRestartProcess(t *testing.T) {
orig := execFn
t.Cleanup(func() { execFn = orig })
execFn = func(string, []string, []string) error { return nil }
if err := restartProcess("/bin/true"); err != nil {
t.Fatalf("expected nil error, got %v", err)
}
execFn = func(string, []string, []string) error { return errors.New("boom") }
if err := restartProcess("/bin/false"); err == nil {
t.Fatal("expected error")
}
}