From dc936f433cf305ec9dbf9df70842303f89fab03f Mon Sep 17 00:00:00 2001 From: morluto <76467478+morluto@users.noreply.github.com> Date: Mon, 19 Oct 2026 20:02:58 +0800 Subject: [PATCH] test(process): distinguish native preparation from capture allocation A missing temporary path stops Darwin native-inspector preparation before capture allocation can account for resources. Keep its progress coverage unknown; Linux reaches the capture root allocation and reports not-required resources. Assert the public typed failure preserves the selected temp path. The combined Electron/progress focused rerun passed 33 tests on macOS arm64 with Node 24.18.0. The seven progress cases passed; native Linux was not run. Static checks, docs checks and test discovery also passed on the final tree. --- .../process/processCaptureProgress.test.ts | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/tests/boundary/process/processCaptureProgress.test.ts b/tests/boundary/process/processCaptureProgress.test.ts index ce50a9f6de..17ab9fb796 100644 --- a/tests/boundary/process/processCaptureProgress.test.ts +++ b/tests/boundary/process/processCaptureProgress.test.ts @@ -289,7 +289,7 @@ itWithCaptureCapability( ); itWithCaptureCapability( - "reports no acquired resources when temporary-root creation fails", + "reports startup cleanup coverage when temporary storage is unavailable", async () => { const scenario = await writeScenario( "rea-process-progress-prepare-failed-", @@ -312,14 +312,25 @@ itWithCaptureCapability( }); expect(capture.exitCode).toBe(1); + const error = analysisCliErrorEnvelopeSchema.parse( + JSON.parse(capture.stdout), + ); + expect(error).toMatchObject({ + code: "process_capture_failed", + details: { execution_failure: expect.stringContaining(missingTempRoot) }, + }); + // Darwin prepares its native inspector before acquiring capture resources. + // Other hosts reach the capture root allocation, whose failure is accounted. + const cleanupState = + process.platform === "darwin" ? "unverified" : "not_required"; expect(capture.lines.at(-1)?.update).toMatchObject({ phase: "cleanup", terminal: true, details: { disposition: "failed", - owned_process_group: "not_required", - terminal_renderer: "not_required", - temporary_root: "not_required", + owned_process_group: cleanupState, + terminal_renderer: cleanupState, + temporary_root: cleanupState, }, }); },