| @@ -159,8 +159,9 @@ describe.skipIf(!isWorkerdAvailable())("runtime-workerd-subprocess", () => { · 158 unmodified lines |
| 159 | await runner.ensureStarted(); | 159 | await runner.ensureStarted(); |
| 160 | const pid = runner.pid(); | 160 | const pid = runner.pid(); |
| 161 | expect(pid).toEqual(expect.any(Number)); | 161 | expect(pid).toEqual(expect.any(Number)); |
| | 162 | if (pid === undefined) throw new Error("workerd pid was unavailable"); |
| 162 | await runner.dispose(); | 163 | await runner.dispose(); |
| 163 | expect(await waitUntilGone(pid as number)).toBe(true); | 164 | expect(await waitUntilGone(pid)).toBe(true); |
| 164 | }); | 165 | }); |
| 165 | | 166 | |
| 166 | it("restarts after a crash", async () => { | 167 | it("restarts after a crash", async () => { |
| @@ -169,8 +170,9 @@ describe.skipIf(!isWorkerdAvailable())("runtime-workerd-subprocess", () => { · 2 unmodified lines |
| 169 | await runner.ensureStarted(); | 170 | await runner.ensureStarted(); |
| 170 | const firstPid = runner.pid(); | 171 | const firstPid = runner.pid(); |
| 171 | expect(firstPid).toEqual(expect.any(Number)); | 172 | expect(firstPid).toEqual(expect.any(Number)); |
| | 173 | if (firstPid === undefined) throw new Error("workerd pid was unavailable"); |
| 172 | runner.crashForTest(); | 174 | runner.crashForTest(); |
| 173 | expect(await waitUntilGone(firstPid as number)).toBe(true); | 175 | expect(await waitUntilGone(firstPid)).toBe(true); |
| 174 | const output = await runner.run<{ value: string }>({ op: "echo", value: "after" }); | 176 | const output = await runner.run<{ value: string }>({ op: "echo", value: "after" }); |
| 175 | expect(output.body.value).toBe("after"); | 177 | expect(output.body.value).toBe("after"); |
| 176 | expect(runner.pid()).not.toBe(firstPid); | 178 | expect(runner.pid()).not.toBe(firstPid); |