Skip to content

Autonomous development for real products. Governed agents build from specs you approve, follow the rules you set, and nothing merges until another agent proves it. Your decisions, judgement and taste are the bar that work must clear. Declare your vision and let agents build it.

fix(tests): keep waiting after Chrome group probe refusals [C7,N26]

Corey Olson865eddc07be7
diff --git a/test/cockpit/fixture.js b/test/cockpit/fixture.js
index cf905e00..a4b4a386 100644
--- a/test/cockpit/fixture.js
+++ b/test/cockpit/fixture.js
@@ -773,8 +773,8 @@ async function openSnapshotChrome(executable, url, profile) {
function ownedChromeGroupAlive(pid) {
try { process.kill(-pid, 0); return true; }
catch (error) {
- if (error.code === 'ESRCH') return false;
- throw error;
+ // A permission error cannot prove that Chrome's sandboxed helpers have exited.
+ return error.code !== 'ESRCH';
}
}
diff --git a/test/cockpit/fixture.test.js b/test/cockpit/fixture.test.js
index ac9bf921..1b64e5ae 100644
--- a/test/cockpit/fixture.test.js
+++ b/test/cockpit/fixture.test.js
@@ -435,7 +435,18 @@ test('owned Chrome cleanup waits out a slow exit and still fails a real hang [C7
await ready(pipeReady);
const holderPid = Number(readFileSync(pipeReady, 'utf8'));
independent.push(holderPid);
- await stopOwnedChrome(pipe.child, pipe.stopped);
+ const nativeKill = process.kill.bind(process);
+ let permissionProbe = false;
+ const kill = t.mock.method(process, 'kill', (pid, signal) => {
+ if (pid === -pipe.child.pid && signal === 0 && !permissionProbe) {
+ permissionProbe = true;
+ throw Object.assign(new Error('probe temporarily refused'), { code: 'EPERM' });
+ }
+ return nativeKill(pid, signal);
+ });
+ try { await stopOwnedChrome(pipe.child, pipe.stopped); }
+ finally { kill.mock.restore(); }
+ assert.equal(permissionProbe, true, 'a refused group probe cannot prove the group has exited');
assert.doesNotThrow(() => process.kill(holderPid, 0), 'cleanup releases stderr without killing an independent holder');
assert.ok(pipe.child.exitCode !== null || pipe.child.signalCode !== null, 'the owned leader exited');