Skip to content

test(herdr): fix Quick Start close test on Linux CI (util-linux script syntax) - #556

Merged
lis186 merged 1 commit into
mainfrom
fix/herdr-qs-close-test-linux
Aug 17, 2026
Merged

test(herdr): fix Quick Start close test on Linux CI (util-linux script syntax)#556
lis186 merged 1 commit into
mainfrom
fix/herdr-qs-close-test-linux

Conversation

@lis186

@lis186 lis186 commented Aug 17, 2026

Copy link
Copy Markdown
Owner

摘要

main 從 #544 起 CI 一直紅在 Herdr Quick Start close › exits the process when the menu is closed:測試用 BSD 語法呼叫 script,util-linux(ubuntu CI)不接受位置參數命令,onboarding 從未啟動、marker 永遠不出現,兩個 Node job 確定性失敗。本 PR 依平台分支 script 呼叫方式,並順手修掉測試在 macOS 上每次吃滿 30s timeout 的假延遲(→ ~250ms)。

Root cause

  • BSD script (macOS): script -q /dev/null <command...> — command as positional args.
  • util-linux script (ubuntu CI): only accepts a command via -c; positional operands after the file are rejected, so the wrapper exited immediately. The inner command (and its >/dev/null 2>&1) swallowed the error, the marker was never written, and the poll printed LINGERED — deterministic on both Node 20 and 22, every push since the test landed on main.

Changes

  • Branch on process.platform: Linux uses script -qec "<cmd>" /dev/null, macOS keeps the BSD positional form.
  • Redirect the background job as a whole: the keystroke-feeder subshell's inherited stderr was holding spawnSync's pipe open until its sleep ended, so even a passing run ate the full 30s timeout. Sleep shrinks 40s → 12s (still well past the 8s poll window).

Verification

  • fail-on-old: every main CI run since bd726f2 fails on exactly this test with actual: LINGERED (runs 31993589901, 32014062729, plus the PR Mark a Herdr badge whose numbers the transcript has outrun, and rescan to fix it #553 run 32010319418).
  • pass-on-new (macOS branch): full test/herdr-plugin.test.js 132/132 green locally with isolated CCXRAY_HOME; the fixed test now completes in ~250ms instead of 30s.
  • pass-on-new (Linux branch): no util-linux script available locally — this PR's own CI run is the differential evidence.

Note: run 31994476657 (#545) also had a one-off count_tokens e2e failure ("proxy did not start") that does not reproduce in the other runs — flaky, not addressed here.

🤖 Generated with Claude Code

BSD script (macOS) takes the command as positional args after the file;
util-linux script (ubuntu CI) rejects positional commands and needs -c,
so the onboarding process never launched on CI and the marker never
appeared — a deterministic LINGERED on both Node jobs. Branch on
platform: `script -qec "<cmd>" /dev/null` on Linux, the BSD form
elsewhere.

Also redirect the background job as a whole: the feeder subshell's
inherited stderr held spawnSync's pipe open until its sleep ended, so
even a passing run ate the full 30s timeout (now ~250ms), and the sleep
shrinks from 40s to 12s — still well past the 8s poll window.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@lis186
lis186 merged commit 99ac693 into main Aug 17, 2026
3 checks passed
@lis186
lis186 deleted the fix/herdr-qs-close-test-linux branch August 17, 2026 09:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant