Skip to content

Commit 7458d46

Browse files
author
ddx-checkpoint
committed
test: isolate workerprobe server state
1 parent a7b9f26 commit 7458d46

2 files changed

Lines changed: 9 additions & 2 deletions

File tree

CHANGELOG.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@ the optional security scans no longer make the workflow invalid when their
1111
secrets are unset. The frontend dependency graph also overrides `devalue` to a
1212
patched version so the high-severity Bun audit finding is cleared. Command test
1313
fixtures now suppress background update checks so CI temp-directory cleanup is
14-
not racing asynchronous network/cache work.
14+
not racing asynchronous network/cache work. The workerprobe integration test
15+
also isolates server state before constructing its test server, preventing CI's
16+
state-pollution guard from seeing worker fixture projects.
1517

1618
### Fixed: autonomous provider-connectivity recovery
1719

cli/internal/agent/workerprobe/probe_integration_test.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,12 @@ func TestWorker_RealAttemptEvents_FlowToServer(t *testing.T) {
5151
proj := buildFixtureRepo(t, binPath, "standard")
5252
bin := binPath
5353

54+
// Isolate server state before constructing the server. New() registers
55+
// the project immediately, so setting XDG_DATA_HOME later still pollutes
56+
// the process-wide state used by CI's server-state guard.
57+
xdg := t.TempDir()
58+
t.Setenv("XDG_DATA_HOME", xdg)
59+
5460
// Real server — same constructor, same Handler, same requireTrusted gate.
5561
srv := serverpkg.New(":0", proj)
5662
ts := httptest.NewServer(srv.Handler())
@@ -59,7 +65,6 @@ func TestWorker_RealAttemptEvents_FlowToServer(t *testing.T) {
5965
// Production discovery path: write server.addr under XDG_DATA_HOME so
6066
// the worker subprocess (running with the same XDG_DATA_HOME) finds it
6167
// via serverpkg.ReadServerAddr.
62-
xdg := t.TempDir()
6368
addrDir := filepath.Join(xdg, "ddx")
6469
if err := os.MkdirAll(addrDir, 0o700); err != nil {
6570
t.Fatalf("mkdir addr dir: %v", err)

0 commit comments

Comments
 (0)