diff --git a/pkg/agent/hook_process_test.go b/pkg/agent/hook_process_test.go index 9b1f0d2e8..9e95d105e 100644 --- a/pkg/agent/hook_process_test.go +++ b/pkg/agent/hook_process_test.go @@ -218,13 +218,14 @@ func TestAgentLoop_MountProcessHook_IsolationSupportsRelativeDirAndCommand(t *te t.Fatal(err) } - if err := al.MountProcessHook(context.Background(), "ipc-relative", ProcessHookOptions{ + mountErr := al.MountProcessHook(context.Background(), "ipc-relative", ProcessHookOptions{ Command: []string{"./hook-helper", "-test.run=TestProcessHook_HelperProcess", "--"}, Dir: relHookDir, Env: processHookHelperEnv("rewrite", ""), InterceptLLM: true, - }); err != nil { - t.Fatalf("MountProcessHook failed with relative dir/command under isolation: %v", err) + }) + if mountErr != nil { + t.Fatalf("MountProcessHook failed with relative dir/command under isolation: %v", mountErr) } resp, err := al.runAgentLoop(context.Background(), agent, processOptions{ diff --git a/pkg/isolation/platform_linux_test.go b/pkg/isolation/platform_linux_test.go index a082b1663..2dcca96ce 100644 --- a/pkg/isolation/platform_linux_test.go +++ b/pkg/isolation/platform_linux_test.go @@ -59,8 +59,8 @@ func TestResolveLinuxWorkingDir_ResolvesRelativeDir(t *testing.T) { t.Fatalf("restore cwd: %v", chdirErr) } }() - if err := os.Chdir(cwd); err != nil { - t.Fatal(err) + if chdirErr := os.Chdir(cwd); chdirErr != nil { + t.Fatal(chdirErr) } resolvedDir, execDir, err := resolveLinuxWorkingDir("./hooks", "./hook.sh")