A local-first multi-agent app development platform, built on PenguinHarness
fix(plugins): ACL runner 的用例用自己的 60s 期限,不再被 vitest 的 5s 默认切掉
lmliheng72a2e112324c
diff --git a/plugins/sandbox-dsh/test/windows-shells.test.ts b/plugins/sandbox-dsh/test/windows-shells.test.tsindex 3d09c18c..520bbdc9 100644--- a/plugins/sandbox-dsh/test/windows-shells.test.ts+++ b/plugins/sandbox-dsh/test/windows-shells.test.ts@@ -80,17 +80,24 @@ const usable = await Promise.resolve(provider)describe.skipIf(!usable)("the real ACL runner (Windows, host-gated)", () => {// What the refusal points at: both PowerShells write inside the Workspace and are denied outside.const pwsh = spawnSync("where", ["pwsh"], { windowsHide: true }).status === 0;- it.each(["powershell", ...(pwsh ? ["pwsh"] : [])])("%s runs confined", (shell) => {- const outside = path.join(homedir(), `adelie-dsh-shells-${shell}-${process.pid}.txt`);- try {- const body = `Set-Content -LiteralPath in-${shell}.txt -Value ok; try { Set-Content -LiteralPath '${outside}' -Value leak -ErrorAction Stop } catch { $_.Exception.Message }`;- const r = run(confine([shell, "-NoLogo", "-NoProfile", "-Command", body]));- expect(r.status).toBe(0);- expect(existsSync(path.join(ws, `in-${shell}.txt`))).toBe(true);- expect(existsSync(outside)).toBe(false);- expect(r.stdout).toMatch(/access to the path .* is denied/i);- } finally {- rmSync(outside, { force: true });- }- });+ // The timeout is the spawn's own, not vitest's 5s default: a cold Windows PowerShell under the+ // restricted token is slow (measured on the runner: 2.6s green, and one run past 5s), and the+ // default would cut it before the child could ever hit the 60s below.+ it.each(["powershell", ...(pwsh ? ["pwsh"] : [])])(+ "%s runs confined",+ (shell) => {+ const outside = path.join(homedir(), `adelie-dsh-shells-${shell}-${process.pid}.txt`);+ try {+ const body = `Set-Content -LiteralPath in-${shell}.txt -Value ok; try { Set-Content -LiteralPath '${outside}' -Value leak -ErrorAction Stop } catch { $_.Exception.Message }`;+ const r = run(confine([shell, "-NoLogo", "-NoProfile", "-Command", body]));+ expect(r.status).toBe(0);+ expect(existsSync(path.join(ws, `in-${shell}.txt`))).toBe(true);+ expect(existsSync(outside)).toBe(false);+ expect(r.stdout).toMatch(/access to the path .* is denied/i);+ } finally {+ rmSync(outside, { force: true });+ }+ },+ 60_000,+ );});