Skip to content

ci: make main's CI green and steady - #161

Merged
fxck merged 6 commits into
mainfrom
fix/ci-steady
Oct 9, 2026
Merged

fxck merged 6 commits into
mainfrom
fix/ci-steady

Conversation

@fxck

@fxck fxck commented Oct 9, 2026 •

Copy link
Copy Markdown
Member

Main's CI failures over the last ~30 runs, each with its cause and fix:

  • Test — hq deploys.test.ts (71 failures, run 37934023035): the test PostgreSQL supervisor refused to freeze the migrated template because a just-closed pool's backend still showed in pg_stat_activity (scripts/test-postgres-supervisor.ts, freeze). The freeze now waits up to 2 s for those backends to exit, as PostgreSQL's own CREATE DATABASE … TEMPLATE does. Covered by a new RED→GREEN harness test.
  • Test Server 1 near/over its 10-minute limit: Vitest's contiguous hash slices put importV1Crew (129 s) and CrewEngine (105 s) in one shard (491 s avg / 590 s max vs 438/439). The server now runs four shards, each taking every 4th sorted path (scripts/lib/spread-shard.ts). This PR's run: 4:57–6:26 per job.
  • Chat Contract (C shard 2), images "messages appear before image bytes…": Base UI keeps a tooltip trigger's hover listener on the first element it rendered. A file chip turns from a button into a link, so after that switch its tooltip never opened. TooltipTrigger now remounts when its element kind changes, with a unit test.
  • composer-overlap "history does not paint through the composer footer": the footer's hard-stop gradient (The conversation runs right up to the docked composer #154) is dithered by Chrome according to its tile, so the screenshots differed by ±1 on every 8th pixel. The footer is now a solid ::before from the card's top edge down.
  • g-outage (11 cases) + foundation/examples (1), local only: these areas aren't in CI. ab1ef8f00 holds a lost link through a 5 s reconnect grace, and the scenario clock never let it run out. then.hq.isUnavailable now advances the installed clock, and the renewal case proves the renewal by its new subscription. No titles changed.
  • Already fixed on main: report-room scroll waits (76c64fe), the menu list-end case (7479079), mate-zone-architecture (9034fe8) and hq changes.test.ts event order (528bc92).

🤖 Generated with Claude Code

fxck added 5 commits October 9, 2026 22:13
A pool's close returns before PostgreSQL's backend exits, so the supervisor
counted a closed migration pool as open and refused the freeze: all 71 tests
of deploys.test.ts failed in CI run 37934023035 with "Close database
connections before freezing a template". The freeze now waits up to 2 s for
the database's backends to leave (as PostgreSQL's own CREATE DATABASE …
TEMPLATE waits for exiting ones) and answers each lease's commands in order.
Vitest's contiguous hash slices put importV1Crew (129 s) and CrewEngine
(105 s) in one shard: Test Server 1 ran 491 s on average and up to 590 s of
its 600 s limit (once cancelled), against 438 s and 439 s for the others.
Four shards that each take every 4th sorted path spread a directory's slow
suites apart: about 310–350 s of tests each by the last run's timings.
ab1ef8f (fix(data): hold what a scope read through a reconnect's grace)
made a lost link read as current for STREAM_POLICY.reconnectGraceMs (5 s)
and ends the hold on the store's own timer. The outage scenarios install
the client clock, whose positive timers run only when advanced, so the
grace never ran out: the menu never said HQ is unavailable and
then.hq.isUnavailable timed out in 11 g-outage cases and foundation's
"G: HQ outage preserves rows and catches up after return". CI's
chat-gate runs c-mate only, so the areas rotted unseen.

then.hq.isUnavailable now passes the grace on an installed clock, one
grace at a time, until the tab says HQ is unavailable: the grace counts
from when the tab noticed the drop, which the harness cannot observe, so
a single advance raced the socket close. The clock says whether it is
installed. No test title changes.
Since ab1ef8f a link HQ ends for its session (4401) holds what it read
through the reconnect grace, so a renewal within the grace shows no
outage line: "successive HQ session endings renew and restore the menu"
no longer can wait for then.hq.isUnavailable. With the previous commit
letting the grace run out it passed only when the line happened to flash
before the renewal.

The case now proves the ending by what follows it: the tab, woken, opens
a new HQ subscription, and the menu is caught up. The wake repeats until
the tab has noticed the ending, since a wake that comes first finds no
recovery to expedite. The title stays.
Since the footer became a hard-stop gradient (#154), "history does not paint
through the composer footer" failed about one run in four: the two
screenshots differed by ±1 in one channel on every 8th pixel of every 8th
row, which is Chrome's gradient dither, its phase set by the tile it lands
in. Hiding the history re-rastered the footer and moved the dither. A
solid ::before from the card's top edge down paints the same colour every
time. The gap above the card stays clear and nothing paints below it. Before:
1 of 4 local runs failed. After: 8 of 8, plus 4 of 4 under eight CPU burners.
Base UI binds a trigger's native mouseenter listener to the element it first
renders and does not rebind when `render` swaps the element. A chat file chip
renders a menu button until its open action is known, then an <a>: hovering
the link afterwards never cleared Base UI's mouse-move block, so its path
tooltip never opened.

This is the intermittent CI failure in Chat Contract (C shard 2), images
"messages appear before image bytes, reserve their size, and reuse previews
on reopen", timing out at waitForSelector('[data-slot="tooltip-popup"]'). A
diagnostic under a 4x CPU throttle showed every failure had the BUTTON ->
A swap, with pointerenter and mousemove delivered to the link and the
pointer still on it; a second move did not open it either.

TooltipTrigger now keys Base UI's trigger on the rendered host element's
tag, so a change of element kind remounts it and its listeners.

Under the 4x throttle the scenario failed 1 of 4 plain runs (and once in a
full shard 2/2 run) before, and passes 6 of 6 after.
@fxck
fxck merged commit 5222d55 into main Oct 9, 2026
39 checks passed
fxck added a commit that referenced this pull request Oct 9, 2026
- #161 ci: make main's CI green and steady
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