Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS
JavaScript ai-agentsdashboarddeveloper-toolsdigital-twinquantified-selfsecond-brainself-hostedtailscale
fix(server): suppress background tasks and keychains in Chrome H.264 probe (#12099)
Adam Eivyb144b70e1573
diff --git a/server/lib/browserSuiteGate.js b/server/lib/browserSuiteGate.jsindex 22702e95b4..445a66e112 100644--- a/server/lib/browserSuiteGate.js+++ b/server/lib/browserSuiteGate.js@@ -113,8 +113,14 @@ export async function probeChromeH264(chromePath, { timeoutMs = PROBE_TIMEOUT_MSif (!chromePath) return { ok: false, cause: 'missing-executable' };const profile = mkdtempSync(join(tmpdir(), 'portos-h264-probe-'));try {- const run = await runOwnedProbe(chromePath, ['--headless=new', '--disable-gpu', '--no-sandbox',- `--user-data-dir=${profile}`, '--virtual-time-budget=2000', '--dump-dom', H264_PROBE_PAGE], { timeoutMs, graceMs });+ const run = await runOwnedProbe(chromePath, [+ '--headless=new', '--disable-gpu', '--no-sandbox',+ '--no-first-run', '--no-default-browser-check',+ '--disable-background-networking', '--disable-component-update',+ '--disable-sync', '--disable-breakpad',+ '--password-store=basic', '--use-mock-keychain',+ `--user-data-dir=${profile}`, '--virtual-time-budget=2000', '--dump-dom', H264_PROBE_PAGE,+ ], { timeoutMs, graceMs });if (run.spawnErrorCode) {return { ok: false, cause: ['ENOENT', 'ENOTDIR'].includes(run.spawnErrorCode) ? 'missing-executable' : 'no-answer' };}diff --git a/server/lib/browserSuiteGate.test.js b/server/lib/browserSuiteGate.test.jsindex 7f8e2bca9d..2e4d337420 100644--- a/server/lib/browserSuiteGate.test.js+++ b/server/lib/browserSuiteGate.test.js@@ -129,4 +129,33 @@ describe('H.264 probe outcomes', () => {expect(browserSuiteCanRun('suite', { 'Chrome with H.264': { probeFailure: 'teardown-failed' }, ffmpeg: null })).toBe(false);expect(log).toHaveBeenCalledWith('⏭️ suite: skipping suite — missing ffmpeg; Chrome with H.264 probe failed (teardown-failed)');});++ it('fails loudly on probe timeout when CI requires browser suites', () => {+ process.env.PORTOS_REQUIRE_BROWSER_SUITES = '1';+ expect(() => browserSuiteCanRun('suite', { 'Chrome with H.264': { probeFailure: 'probe-timeout' }, ffmpeg: '/usr/bin/ffmpeg' }))+ .toThrow('suite: browser suite skipped but PORTOS_REQUIRE_BROWSER_SUITES is set — Chrome with H.264 probe failed (probe-timeout)');+ });++ posix('supplies background and credential suppression flags to prevent probe teardown hangs', async () => {+ const argsFile = join(mkdtempSync(join(tmpdir(), 'portos-fake-args-')), 'args.json');+ dirs.push(join(argsFile, '..'));+ const chrome = fakeChrome(`+ require('node:fs').writeFileSync(${JSON.stringify(argsFile)}, JSON.stringify(process.argv.slice(2)));+ process.stdout.write('<body>H264:probably</body>');+ `);+ const result = await probeChromeH264(chrome);+ expect(result).toEqual({ ok: true, chromePath: chrome });+ const passedArgs = JSON.parse(readFileSync(argsFile, 'utf8'));+ expect(passedArgs).toEqual(expect.arrayContaining([+ '--no-first-run',+ '--no-default-browser-check',+ '--disable-background-networking',+ '--disable-component-update',+ '--disable-sync',+ '--disable-breakpad',+ '--password-store=basic',+ '--use-mock-keychain',+ ]));+ });});+