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.
This commit is contained in:
yetone
2026-11-12 08:06:44 +08:00
parent 1492d9c3be
commit 234e073c60
+1 -1
View File
@@ -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",
})