From 34b4516aa70aa55198e39bf08343cdc5a56f0fa9 Mon Sep 17 00:00:00 2001 From: Evan Jarrett Date: Mon, 24 Aug 2026 15:49:51 -0500 Subject: [PATCH] test/e2e: correct the claim that headed Chromium cannot launch here It can, and normally in well under a second. Two launches hung for the full 180s handshake timeout under heavy concurrent docker and test load, and I wrote that up as "headed is impossible from an agent shell" and moved everything to headless. That was wrong, and wrong in a way that would have quietly degraded every future browser check. The display is reachable: DISPLAY=:0, XAUTHORITY set to the mutter XWayland cookie, both the Wayland socket and /tmp/.X11-unix/X0 present, xdpyinfo happy. The README now says to check xdpyinfo and retry rather than conclude anything, and batch10-anonpull.mjs defaults to headed again. Co-Authored-By: Claude Opus 5 (1M context) Claude-Session: https://claude.ai/code/session_01SeaUS5AFPX9gqCahoLRMRh --- test/e2e/README.md | 14 ++++++++------ test/e2e/batch10-anonpull.mjs | 2 ++ 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/test/e2e/README.md b/test/e2e/README.md index 4134a37..50ac57d 100644 --- a/test/e2e/README.md +++ b/test/e2e/README.md @@ -73,12 +73,14 @@ concluding anything from a 404. text finds nothing and reports "no tags render" against a page that is rendering them correctly. -**A headed browser will not launch from an agent shell here.** Both -`chromium.launch()` and `launchPersistentContext()` time out on the handshake -despite `DISPLAY=:0` being set; headless works. Interactive flows (the admin -login, `docker-credential-atcr login`) still need a human at a real browser — -but non-interactive page checks can run headless, and `batch10-anonpull.mjs` -does. +**Headed works; if it times out, retry before concluding otherwise.** A headed +`launchPersistentContext` normally comes up in well under a second — the +display is reachable (`DISPLAY=:0`, `XAUTHORITY` set to the mutter XWayland +cookie, both the Wayland socket and `/tmp/.X11-unix/X0` present; `xdpyinfo` +confirms it). Two launches did once hang for the full 180s handshake timeout +under heavy concurrent docker and test load, which is easy to misread as "headed +is impossible here" and switch everything to headless. It is not. Check +`xdpyinfo` and retry. **Logged-out checks need their own profile.** `lib.mjs`'s `PROFILE` is signed in, and clearing its cookies costs an interactive re-login for everything else. diff --git a/test/e2e/batch10-anonpull.mjs b/test/e2e/batch10-anonpull.mjs index 42570c0..f68589a 100644 --- a/test/e2e/batch10-anonpull.mjs +++ b/test/e2e/batch10-anonpull.mjs @@ -18,6 +18,8 @@ import { APPVIEW } from './lib.mjs'; const HOLD = process.env.ATCR_HOLD_URL ?? 'http://127.0.0.1:8080'; const HANDLE = process.env.ATCR_E2E_HANDLE ?? 'evan.jarrett.net'; const REPO = process.env.ATCR_E2E_REPO ?? 'valtest'; +// Defaults to headed, which is how these are meant to be watched. +// ATCR_E2E_HEADLESS=1 for unattended runs. const HEADLESS = process.env.ATCR_E2E_HEADLESS === '1'; const captain = await fetch(