Skip to content

test: split fm-supervision-host suite and use deadline hand-back waits - #7828

Open
kunchenguid wants to merge 5 commits into
mainfrom
fm/mainred-04-supervision-host-split
Open

kunchenguid wants to merge 5 commits into
mainfrom
fm/mainred-04-supervision-host-split

Conversation

@kunchenguid

Copy link
Copy Markdown
Owner

Speaking as Kun's firstmate: this is a test-only fix for the main-red portable-serial-1of9 flake (FM-MAINRED-04). The captain approved the scope; the captain merges this PR.

Why

tests/fm-supervision-host.test.sh ran 90 tests in one serial shard. It took 1041–1716s against the 1800s job cap, and its fixed wait_until 200|250 host_exited hand-back waits were too tight under load. Serial 1 on main passed 6 of 15 attempts from Oct 23 to Oct 26.

What

  • Split into four files. Shared fixtures live in tests/supervision-host-helpers.sh. Each test is defined once and registered once, in its original order.

    File Tests Hint (ms) Shard
    tests/fm-supervision-host.test.sh (wakes, closes, mirror, return) 29 435581 serial 2
    tests/fm-supervision-host-hook.test.sh 24 403793 serial 3
    tests/fm-supervision-host-drain.test.sh 17 45950 serial 5
    tests/fm-supervision-host-park.test.sh (latch, park, compaction, lock ownership) 20 329326 serial 8
  • Honest hints. Each hint is the local runtime × 2.3. bin/fm-test-run.sh --check-coverage passes with serial_max_ms=1196761 against the 1200000 budget.

  • Time-based hand-back waits. All hard host and hook hand-back waits (74 in total) now use wait_until_deadline 60. On timeout it dumps host.out, hook.out/hook.err, the supervision-host log, the health file and a process tree.

  • Waits left as poll counts on purpose. Probe waits and clock-bounded park-boundary waits stay poll-count, so a broken host can't pass just because enough wall-clock time went by.

  • CONTRIBUTING.md. Adds a carve-out for these deadline waits.

  • Not changed: .github/workflows, timeout-minutes, and product or latch logic.

Review

Two fresh adversarial reviews were run. The final one, on f953f6d, is low risk with info-only notes: a stale header comment on wait_until_deadline, and the original rationale comment above leave_a_cycle_for_main_and_restart was dropped in the move.

kunchenguid and others added 5 commits October 26, 2026 23:49
Split tests/fm-supervision-host.test.sh into drain, host-loop, and hook
files so no portable serial shard carries the whole 90-test suite.
Shared stub-engine fixtures live in tests/supervision-host-helpers.sh.

Replace the fixed 200/250-poll host and hook hand-back waits with a 60s
deadline helper that dumps host.out, the supervision-host log, health
file, and a process tree on timeout.

Rebalance portable serial packing hints for the three files. No workflow
or timeout-minutes changes.

Co-authored-by: Kun Chen <kunchenguid@users.noreply.github.com>
The restarting-host second-close wait is a probe that may be false; a
60s deadline wait dumped diagnostics on the passing path. Restore
wait_until 200 there and keep the following assertion on the 60s
deadline.

Drive wait_until_deadline from bash SECONDS so each 0.1s poll does not
spawn date.

Co-authored-by: Kun Chen <kunchenguid@users.noreply.github.com>
Move latch, park boundary, compaction, and lock-ownership cases into
tests/fm-supervision-host-park.test.sh so the supervision-host suite is
four files (drain, hook, host loop, park). All 90 tests remain, each
file declaring its own count.

Set portable serial hints from local duration_ms scaled by ~2.3 so
coverage packing no longer under-hints the host loop. Note the
wait_until_deadline carve-out for host and Stop-hook hand-back waits.

Co-authored-by: Kun Chen <kunchenguid@users.noreply.github.com>
park_after_stop and the leftover hook_exited/host_exited hand-back waits
now use wait_until_deadline 60 so a timeout dumps the fixture logs.
Park probe and park-boundary waits stay poll-counted.

Call fm_test_run directly in the four split files, matching the base
suite. Reword the CONTRIBUTING carve-out so the dump list matches the
helper.

Co-authored-by: Kun Chen <kunchenguid@users.noreply.github.com>
REPORT, DISPATCH, LEASE, and PARK_OUTCOME are assigned in
tests/supervision-host-helpers.sh and read by the sourcing split test
files, so a standalone helper lint reports SC2034. Disable it on those
assignments with the same reason the other shared test helpers use.

Co-authored-by: Kun Chen <kunchenguid@users.noreply.github.com>
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