Repository navigation
test: split fm-supervision-host suite and use deadline hand-back waits - #7828
Open
kunchenguid wants to merge 5 commits into
Open
kunchenguid wants to merge 5 commits into
kunchenguid wants to merge 5 commits into
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Speaking as Kun's firstmate: this is a test-only fix for the main-red
portable-serial-1of9flake (FM-MAINRED-04). The captain approved the scope; the captain merges this PR.Why
tests/fm-supervision-host.test.shran 90 tests in one serial shard. It took 1041–1716s against the 1800s job cap, and its fixedwait_until 200|250 host_exitedhand-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.tests/fm-supervision-host.test.sh(wakes, closes, mirror, return)tests/fm-supervision-host-hook.test.shtests/fm-supervision-host-drain.test.shtests/fm-supervision-host-park.test.sh(latch, park, compaction, lock ownership)Honest hints. Each hint is the local runtime × 2.3.
bin/fm-test-run.sh --check-coveragepasses withserial_max_ms=1196761against 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 dumpshost.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 aboveleave_a_cycle_for_main_and_restartwas dropped in the move.