Skip to content

Doubao-powered voice input for Linux, Wayland and Omarchy

fix(e2e): wait for Omarchy host display

quanrufd40f00c773c
diff --git a/tests/e2e/midscene.config.ts b/tests/e2e/midscene.config.ts
index 76ac216..7748943 100644
--- a/tests/e2e/midscene.config.ts
+++ b/tests/e2e/midscene.config.ts
@@ -81,7 +81,10 @@ const setup = defineProjectSetup<DesktopContext>({
const createAgent = async () => {
const agent = await agentForComputer({
// Later case agents share the Xvfb display hosting Fluxbox and libnut.
- headless: desktopReady ? false : undefined,
+ // The Omarchy harness owns a readiness-checked Xvfb process. Avoid the
+ // ComputerAgent's fixed 500 ms Xvfb startup delay, which can race with
+ // libnut initialization and terminate the whole Node process.
+ headless: desktopReady || omarchy ? false : undefined,
xvfbResolution: omarchy ? '1280x800x24' : '1280x960x24',
// libnut and the VNC viewer may still hold X11 connections while the
// Agent finalizes its report. Stop Xvfb only after this process exits.
diff --git a/tests/e2e/run-omarchy-midscene.sh b/tests/e2e/run-omarchy-midscene.sh
index a4a8e0c..b50c9c0 100755
--- a/tests/e2e/run-omarchy-midscene.sh
+++ b/tests/e2e/run-omarchy-midscene.sh
@@ -18,8 +18,12 @@ export NODE_OPTIONS="${NODE_OPTIONS:-} --require=$ROOT_DIR/tests/e2e/node_module
export OMARCHY_SSH_KEY="$SSH_KEY"
VM_PID=""
+XVFB_PID=""
cleanup() {
+ if [[ -n $XVFB_PID ]]; then
+ kill "$XVFB_PID" 2>/dev/null || true
+ fi
if [[ -n $VM_PID ]]; then
kill "$VM_PID" 2>/dev/null || true
fi
@@ -157,6 +161,30 @@ ssh_guest "test -f /home/omarchy/.local/share/applications/doubao-say.desktop &&
# overlap the product's own recording overlay in VNC screenshots.
ssh_session "omarchy-shell notifications dismissAll"
+# Start the host display ourselves and verify it before libnut connects. The
+# ComputerAgent's built-in Xvfb launcher only waits a fixed 500 ms, which can
+# race on busy Actions runners and crash before a report can be written.
+export DISPLAY=:99
+Xvfb "$DISPLAY" -screen 0 1280x800x24 -ac -nolisten tcp \
+ >"$WORK_DIR/xvfb.log" 2>&1 &
+XVFB_PID=$!
+for _xvfb_attempt in {1..50}; do
+ if xdpyinfo -display "$DISPLAY" >/dev/null 2>&1; then
+ break
+ fi
+ if ! kill -0 "$XVFB_PID" 2>/dev/null; then
+ cat "$WORK_DIR/xvfb.log" >&2
+ echo "Host Xvfb exited before becoming ready." >&2
+ exit 1
+ fi
+ if ((_xvfb_attempt == 50)); then
+ cat "$WORK_DIR/xvfb.log" >&2
+ echo "Host Xvfb did not become ready." >&2
+ exit 1
+ fi
+ sleep 0.2
+done
+
case "$MIDSCENE_PROJECT" in
omarchy-shard-[1-4])
npm --prefix tests/e2e test -- --project "$MIDSCENE_PROJECT"