Skip to content

Commit d6a174b

Browse files
committed
test(daemon): accept fast owned-session cleanup
1 parent 42f2395 commit d6a174b

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

‎packages/coding-agent/test/daemon-supervisor-process.test.ts‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1612,7 +1612,6 @@ if (path) fs.appendFileSync(path, JSON.stringify({ pid: process.pid, role: proce
16121612

16131613
const observer = await connectEventually(socketPath, supervisor);
16141614
try {
1615-
let sawStopping = false;
16161615
let settled = false;
16171616
const deadline = Date.now() + 50_000;
16181617
while (Date.now() < deadline) {
@@ -1622,14 +1621,14 @@ if (path) fs.appendFileSync(path, JSON.stringify({ pid: process.pid, role: proce
16221621
});
16231622
if (!response.success) throw new Error(response.error);
16241623
const status = (response.data as { status?: string } | undefined)?.status;
1625-
if (status === "stopping") sawStopping = true;
16261624
if (status === "settled") {
16271625
settled = true;
16281626
break;
16291627
}
16301628
await new Promise((resolveDelay) => setTimeout(resolveDelay, 50));
16311629
}
1632-
expect(sawStopping).toBe(true);
1630+
// `settled` is the authoritative result; the observer may miss the
1631+
// transient `stopping` phase when registration and cleanup race.
16331632
expect(settled).toBe(true);
16341633
await waitForProcessGone(descriptor.pid);
16351634
workerPids.delete(descriptor.pid);

0 commit comments

Comments
 (0)