Skip to content

Commit b097d64

Browse files
steipeteampagent
andauthored
1 parent 67ea9c2 commit b097d64

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

‎src/node-host/node-worker-supervisor.recovery.test.ts‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ describe("node worker supervisor recovery", () => {
266266
spawned.add(workerProcess);
267267
const worker = requireNodeWorkerProcessIdentity(workerProcess.pid!);
268268
ownedProcessGroups.push(worker);
269-
await vi.waitFor(() => expect(fs.existsSync(marker)).toBe(true));
269+
await vi.waitFor(() => expect(fs.readFileSync(marker, "utf8")).toMatch(/^[1-9]\d*$/u));
270270
const grandchild = requireNodeWorkerProcessIdentity(Number(fs.readFileSync(marker, "utf8")));
271271
const input = testWorkerLaunchInput(workspaceDir, "stale-running-launch", "wait");
272272
const supervisor = createNodeWorkerSupervisor({ bundleRoot, env });
@@ -348,7 +348,9 @@ describe("node worker supervisor recovery", () => {
348348
const owned = JSON.parse(await waitForChildLine(owner)) as NodeWorkerLaunchReceipt;
349349
ownedProcessGroups.push(owned.worker!);
350350
const grandchildPath = path.join(workspaceDir, "grandchild.pid");
351-
await vi.waitFor(() => expect(fs.existsSync(grandchildPath)).toBe(true));
351+
await vi.waitFor(() =>
352+
expect(fs.readFileSync(grandchildPath, "utf8")).toMatch(/^[1-9]\d*$/u),
353+
);
352354
const grandchild = requireNodeWorkerProcessIdentity(
353355
Number(fs.readFileSync(grandchildPath, "utf8")),
354356
);

‎src/node-host/node-worker-supervisor.test.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -665,7 +665,7 @@ describe("node worker supervisor", () => {
665665
const running = await supervisor.launch(input, TEST_WORKER_ENDPOINT);
666666
expect(running.state).toBe("running");
667667
const grandchildPath = path.join(workspaceDir, "grandchild.pid");
668-
await vi.waitFor(() => expect(fs.existsSync(grandchildPath)).toBe(true));
668+
await vi.waitFor(() => expect(fs.readFileSync(grandchildPath, "utf8")).toMatch(/^[1-9]\d*$/u));
669669
const grandchildPid = Number(fs.readFileSync(grandchildPath, "utf8"));
670670
const grandchild = requireNodeWorkerProcessIdentity(grandchildPid);
671671
expect(inspectNodeWorkerProcessIdentity(grandchild)).toBe("live");

0 commit comments

Comments
 (0)