fix: pre-landing review fixes

The new dotenv-isolation test spawns Bun with emptyBunConfig() instead of a
literal --config=/dev/null, which the Windows lane cannot open; the runner's
timeout case asserts the descendant published a pid before asking whether it
is running, so a missed readiness window names itself.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
This commit is contained in:
garrytanandcapy-ai[bot] committed 2026-10-26 14:34:30 +00:00
1 parent ec36e9089d
commit 4dcd7f3ca3
2 files changed
+5 -2

No files matched your search

+2 -1
View File
@@ -7,6 +7,7 @@ import { afterEach, beforeEach, describe, expect, test } from 'bun:test';
import * as fs from 'node:fs';
import * as os from 'node:os';
import * as path from 'node:path';
import { emptyBunConfig } from '../src/bun-child-config';
import { spawnTerminalAgent } from '../src/terminal-agent-control';
const ROOT = path.resolve(import.meta.dir, '..', '..');
@@ -60,7 +61,7 @@ describe('D0: project .env and bunfig.toml are ignored', () => {
expect(JSON.parse(await waitForFile(out))).toEqual({ sandbox: null });
const atomic = path.join(path.dirname(project), 'atomic.json');
fs.writeFileSync(path.join(path.dirname(project), 'atomic-probe.ts'), probeSource(atomic));
const run = Bun.spawnSync([process.execPath, '--no-env-file', '--config=/dev/null', path.join(path.dirname(project), 'atomic-probe.ts')], { cwd: project, env: { PATH: process.env.PATH ?? '' }, stdout: 'pipe', stderr: 'pipe', timeout: 30_000 });
const run = Bun.spawnSync([process.execPath, '--no-env-file', `--config=${emptyBunConfig()}`, path.join(path.dirname(project), 'atomic-probe.ts')], { cwd: project, env: { PATH: process.env.PATH ?? '' }, stdout: 'pipe', stderr: 'pipe', timeout: 30_000 });
expect(run.exitCode, run.stderr.toString()).toBe(0);
expect(JSON.parse(fs.readFileSync(atomic, 'utf-8'))).toEqual({ sandbox: null });
expect(fs.existsSync(atomic + '.tmp')).toBe(false);
+3 -1
View File
@@ -306,7 +306,9 @@ describe('Claude Code restricted execution', () => {
expect(fireTimeout).toBeDefined();
const readyBy = Date.now() + 2000;
while (publishedPid() === undefined && Date.now() < readyBy) await Bun.sleep(5);
expect(running(publishedPid()!)).toBe(true);
const descendantPid = publishedPid();
expect(descendantPid, 'descendant never published its pid within the readiness window').toBeDefined();
expect(running(descendantPid!)).toBe(true);
const start = Date.now();
const expire = fireTimeout!;
fireTimeout = undefined;