Skip to content

test: fix main's red portable serial 2 and serial 9 - #50

Merged
arjmad merged 3 commits into
mainfrom
fm/fm-main-ci-serial-fix
Oct 4, 2026
Merged

arjmad merged 3 commits into
mainfrom
fm/fm-main-ci-serial-fix

Conversation

@arjmad

@arjmad arjmad commented Oct 4, 2026

Copy link
Copy Markdown
Owner

Main's CI at d472b71 fails Behavior portable serial 2 and serial 9 for two unrelated reasons, neither caused by #48.
This PR fixes both at their cause without skipping, weakening, or rebounding any test.

Serial 9 - Pi 1.0.1 renamed the export renderer lookup (version drift)

CI installs @earendil-works/pi-coding-agent unpinned.
The last green main run installed Pi 1.0.0; the red runs installed 1.0.1, and upstream CI now installs 1.0.2.
Pi 1.0.1's createToolHtmlRenderer reads getToolRenderers and ignores getToolDefinition, so the Calm fixture that passed only the old key rendered every tool as missing: grep disappeared from /export calm.html HTML while calm mode was on.

Real Calm /export is unaffected: Pi's session export resolves renderers through resolveToolRenderers(name, () => getToolDefinition(name)), and Calm registers no renderer resolver, so export still renders the registered definition.
Only the fixtures were stale.

  • Cherry-picks upstream's fixture fix (test: support Pi 1.0.1 export renderer API in Calm fixture kunchenguid/firstmate#6530), which supplies both keys.
  • The same rename made a sibling check vacuous: tests/fm-pi-branch-extension.test.sh asserts that fm_branch_outcomes export rendering falls back to Pi's structured output, and on Pi 1.0.1 an old-key-only renderer returns that fallback for every tool without reading the definition.
    It now supplies both keys and fails when a renderer never consults its definition.

Serial 2 - leaked per-case processes in the supervision-host test

tests/fm-supervision-host.test.sh is the only script in serial 2.
Its homes were stopped only by the EXIT trap, so each finished case left its fake session, parked host, arm, and FM_POLL=1 watcher running beside every later case.
On the fork's 2-vCPU runner that load grows with the case count: comparing a 501 s run with a 1499 s run case by case, the early drain cases are about 1.1-1.4x slower while the late host cases are 3-9x slower.
Across 26 recent fork runs its duration ranged from 506 s to over the 1500 s per-script bound, which it crossed on main (job 111246613826) and in run 37087431811, and passed at 1488 s once.

pass now stops the homes registered since the previous case and forgets them, so the EXIT trap only stops a failed case's homes.

Verification

  • Pi 1.0.0, 1.0.1, and 1.0.2 installed with the CI layout (npm install -g --prefix) under FM_PI_PACKAGE_DIR, on macOS:
    • tests/fm-calm-pi-extension.test.sh reproduced CI's renderer failure on 1.0.1 before the cherry-pick and passes that case after it on 1.0.1 and 1.0.2.
    • tests/fm-pi-branch-extension.test.sh passes on 1.0.0, 1.0.1, and 1.0.2 (52 ok), and fails with the new guard when the fixture is reverted to the old key only on 1.0.1.
  • tests/fm-supervision-host.test.sh locally, sampling live fixture processes every 5 s: before, 73/73 ok in about 627 s with up to 24 fixture processes alive; after, 73/73 ok in 502 s with at most 2 alive and none left after exit.
  • bin/fm-lint.sh on the three changed test files with ShellCheck 0.11.0 is clean.

Known local gap: one later live tmux case in tests/fm-calm-pi-extension.test.sh (/export did not complete while calm mode was on) fails on this macOS host with every Pi version, including 1.0.0, so it is environmental here; it passed on Linux CI on Pi 1.0.0 (fork) and 1.0.2 (upstream run 37176050503). This PR's CI is the check for it on the fork runner.

kunchenguid and others added 3 commits October 4, 2026 02:20
Pi 1.0.1's createToolHtmlRenderer reads getToolRenderers and ignores
getToolDefinition. Calm /export still includes stock grep HTML; the
fixture has to pass the lookup key the installed Pi actually reads.
….0.1

Pi 1.0.1's createToolHtmlRenderer reads getToolRenderers and ignores
getToolDefinition. Given only the old key, it throws inside its own
try/catch and returns undefined for every tool, so the check that
fm_branch_outcomes' Calm export rendering falls back to Pi's structured
output passed without ever reaching either definition.

Supply both lookup keys, as the Calm export fixture now does, and fail
when a renderer never consults its definition, so a future rename cannot
make the check vacuous again.
Every case's homes were stopped only by the suite's EXIT trap, so each
finished case left its fake session, parked host, arm, and FM_POLL=1
watcher running beside every later case. On the fork's 2-vCPU runner
that load grew with the case count: per-case durations stretched from
about 1.2x the fast-run time early in the script to 3-9x by its last
cases, and the script's total ranged from 506 s to over the 1500 s
per-script bound, failing portable serial 2 on main (job 111246613826)
and in run 37087431811.

pass now stops the homes registered since the previous case and forgets
them, so the EXIT trap only stops the homes of a case that failed. A
local run held at most two fixture processes alive (against 24 before)
and finished in 502 s (against about 627 s), with all 73 cases passing.
@arjmad
arjmad merged commit 3a6d549 into main Oct 4, 2026
24 checks passed
@arjmad
arjmad deleted the fm/fm-main-ci-serial-fix branch October 4, 2026 07:04
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.

2 participants