瀏覽代碼

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.
Chinesezjc 1 月之前
父節點
當前提交
6d9776a3b0
共有 2 個文件被更改,包括 2 次插入 和 0 次删除
  1. 1 0
      packages/spill/spill-local/src/store.ts
  2. 1 0
      packages/subprocess/subprocess-local/src/spawn.ts

+ 1 - 0
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 })
 })

+ 1 - 0
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 })
 })