From 0ce364a391863009da0fad438495b5ba2f33ac76 Mon Sep 17 00:00:00 2001 From: Brennan Benson <79079362+brennanb2025@users.noreply.github.com> Date: Mon, 27 Jul 2026 16:27:26 -0700 Subject: [PATCH] test(runtime): stand in a real live pid for the sibling-runtime case Windows never assigns pid 1, so the hardcoded sibling read as dead there and the watch would reclaim the record. Own a synthetic pid instead and let process.pid play the live sibling. --- src/main/runtime/runtime-rpc.test.ts | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/main/runtime/runtime-rpc.test.ts b/src/main/runtime/runtime-rpc.test.ts index 36bfec06e6a..73b309efe5f 100644 --- a/src/main/runtime/runtime-rpc.test.ts +++ b/src/main/runtime/runtime-rpc.test.ts @@ -367,14 +367,19 @@ describe('OrcaRuntimeRpcServer', () => { it('leaves runtime metadata owned by a live sibling runtime untouched', async () => { const userDataPath = mkdtempSync(join(tmpdir(), 'orca-runtime-rpc-')) - const server = new OrcaRuntimeRpcServer({ runtime: new OrcaRuntimeService(), userDataPath }) + // Why: a synthetic owned pid frees the always-alive process.pid to stand in for + // the sibling — Windows never assigns pid 1, so hardcoding it there reads as dead. + const server = new OrcaRuntimeRpcServer({ + runtime: new OrcaRuntimeService(), + userDataPath, + pid: 4242 + }) await server.start() writeRuntimeMetadata(userDataPath, { - // Why: pid 1 is always alive and never this process, so it stands in for a live sibling runtime. runtimeId: 'rt_live_sibling', - pid: 1, - transports: [{ kind: 'unix', endpoint: join(userDataPath, 'o-1-rt2.sock') }], + pid: process.pid, + transports: [{ kind: 'unix', endpoint: join(userDataPath, `o-${process.pid}-rt2.sock`) }], authToken: 'sibling-token', startedAt: 1 })