From 6d9776a3b0cd387d63756d100c278ef313e9d371 Mon Sep 17 00:00:00 2001 From: Chinesezjc Date: Thu, 3 Sep 2026 16:35:45 +0800 Subject: [PATCH] test: exempt process-exit spill cleanup from the per-file coverage gate The exit listener runs after the coverage dump, so its body can never be measured by the unit coverage lane; mark it v8-ignore with the reason, as with other process-exit-only code paths. --- packages/spill/spill-local/src/store.ts | 1 + packages/subprocess/subprocess-local/src/spawn.ts | 1 + 2 files changed, 2 insertions(+) diff --git a/packages/spill/spill-local/src/store.ts b/packages/spill/spill-local/src/store.ts index e3ebd4b07a..1dc679798b 100644 --- a/packages/spill/spill-local/src/store.ts +++ b/packages/spill/spill-local/src/store.ts @@ -41,6 +41,7 @@ export function privateRoot(): string { // The spill root is private to this process, so it is removed when the process // ends normally; a process killed with SIGKILL cannot run this, and its // residue is left to OS temp hygiene. +/* v8 ignore next 3 -- exit listeners run after the coverage dump; removal is verified by the CI /tmp residue measurement. */ process.once('exit', () => { if (defaultRoot !== undefined) rmSync(defaultRoot, { recursive: true, force: true }) }) diff --git a/packages/subprocess/subprocess-local/src/spawn.ts b/packages/subprocess/subprocess-local/src/spawn.ts index 058dd32f79..a06eb7f0d1 100644 --- a/packages/subprocess/subprocess-local/src/spawn.ts +++ b/packages/subprocess/subprocess-local/src/spawn.ts @@ -94,6 +94,7 @@ function privateSpillDir(): string { // The spill directory is private to this process, so it is removed when the // process ends normally; a process killed with SIGKILL cannot run this, and // its residue is left to OS temp hygiene. +/* v8 ignore next 3 -- exit listeners run after the coverage dump; removal is verified by the CI /tmp residue measurement. */ process.once('exit', () => { if (defaultSpillDir !== undefined) rmSync(defaultSpillDir, { recursive: true, force: true }) })