From c487d6b8bc6a4b38e7f3a00b6fa32caabd38340a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Manso?= Date: Tue, 4 Aug 2026 10:31:54 +0100 Subject: [PATCH] test(acpdbg): resolve the helper process by absolute path (#2245) --- apps/backend/internal/agent/acpdbg/ops_test.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/apps/backend/internal/agent/acpdbg/ops_test.go b/apps/backend/internal/agent/acpdbg/ops_test.go index 1bacf4bc84..3d54ca721c 100644 --- a/apps/backend/internal/agent/acpdbg/ops_test.go +++ b/apps/backend/internal/agent/acpdbg/ops_test.go @@ -33,9 +33,16 @@ func TestProbe_DefaultWorkdirReachesSessionNew(t *testing.T) { ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second) defer cancel() + // os.Executable rather than os.Args[0]: the runner gives the child its own + // working directory, so a relative argv[0] — what you get running the binary + // as ./pkg.test after `go test -c` — would not resolve there. + self, err := os.Executable() + if err != nil { + t.Fatalf("locate test binary: %v", err) + } runner, err := NewRunner(ctx, filepath.Join(t.TempDir(), "frames.jsonl"), RunConfig{ AgentID: "helper", - Command: []string{os.Args[0], "-test.run=^TestACPDBGHelperProcess$"}, + Command: []string{self, "-test.run=^TestACPDBGHelperProcess$"}, }) if err != nil { t.Fatalf("NewRunner() error = %v", err)