From 234e073c60564d4dfc1fd9576b43667128d2f859 Mon Sep 17 00:00:00 2001 From: yetone Date: Thu, 12 Nov 2026 08:06:40 +0800 Subject: [PATCH] nowledge-mem test: headless Chrome no longer hangs on its component updater (#972) The "narrow settings footer" test spawns Chrome with --dump-dom. Chrome 151 (Chrome for Testing, and the runner's stable) intermittently never exits: its SODA on-demand component update and the component updater/breakpad start-up stall, so the process outlived the test's 30s and was killed. This failed the publish run 43122260448 (page-chat 0.1.14) and 52e31c4a. Cause fixed, not the timeout: the test now starts Chrome with the speech (SODA), component-update, breakpad, field-trial and default-app start-up work turned off, so --dump-dom exits as soon as the page is dumped. Run (WSL magpie-desktop via wsl-run, Chrome for Testing 151 as `chromium`, HOME=$(mktemp -d), bun 1.4.2): - old code: red, timed out at 30s (reproduced; plain chrome --dump-dom of a trivial page hung 15s in 4 of 4 runs with only the SODA flag) - with the flags: green 3 of 3, ~0.8s each; the flag set exited in 0.4-1s in 8 of 8 bare chrome runs Not run: the full bun test suite; GitHub's own runner. --- packages/nowledge-mem/page-layout.test.mjs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/nowledge-mem/page-layout.test.mjs b/packages/nowledge-mem/page-layout.test.mjs index ad1b7fe..fd0e631 100644 --- a/packages/nowledge-mem/page-layout.test.mjs +++ b/packages/nowledge-mem/page-layout.test.mjs @@ -44,7 +44,7 @@ test.skipIf(!chrome)("narrow settings footer keeps translated actions inside the const temp = await mkdtemp(join(tmpdir(), "nowledge-layout-")) try { const proc = Bun.spawn({ - cmd: [chrome, "--headless=new", "--no-sandbox", "--disable-gpu", "--disable-dev-shm-usage", "--disable-background-networking", "--disable-extensions", "--disable-sync", "--no-first-run", "--no-default-browser-check", "--password-store=basic", "--host-resolver-rules=MAP * ~NOTFOUND", `--user-data-dir=${temp}/profile`, "--window-size=1200,1600", "--dump-dom", `data:text/html;charset=utf-8,${encodeURIComponent(page)}`], + cmd: [chrome, "--headless=new", "--no-sandbox", "--disable-gpu", "--disable-dev-shm-usage", "--disable-background-networking", "--disable-extensions", "--disable-sync", "--disable-features=OnDeviceSpeechRecognition,SODA,OptimizationHints,MediaRouter,Translate", "--disable-component-update", "--disable-breakpad", "--disable-field-trial-config", "--no-service-autorun", "--disable-default-apps", "--no-first-run", "--no-default-browser-check", "--password-store=basic", "--host-resolver-rules=MAP * ~NOTFOUND", `--user-data-dir=${temp}/profile`, "--window-size=1200,1600", "--dump-dom", `data:text/html;charset=utf-8,${encodeURIComponent(page)}`], env: { HOME: temp, PATH: "/usr/bin:/bin", XDG_CONFIG_HOME: `${temp}/config`, XDG_CACHE_HOME: `${temp}/cache` }, stdout: "pipe", stderr: "pipe", })