Repository navigation
test: fix host-dependent CI flakes in comm collation and orphan-wait fixtures - #7391
Open
ardydedase wants to merge 2 commits into
Open
ardydedase wants to merge 2 commits into
ardydedase wants to merge 2 commits into
Conversation
…host semantics fm-test-run.sh feeds every comparison from LC_ALL=C sort -u but ran bare comm, so any full-collation locale (for example the vi_VN CI host default) made comm die with "input is not in sorted order" and the coverage guard exit red. Pin LC_ALL=C on every comm the same way its feeding sorts already are. The session-lock ancestry fixtures waited for an orphan's ppid to become 1, which never happens on a PR_SET_CHILD_SUBREAPER host: the orphan is reparented to the subreaper instead, so the wait burns its whole bounded loop (about 30s wall on a busy host, past the fixture's 20s deadline) and the suite dies with "the fixture hook never finished". Its recycle assertion likewise required an init reparent after the daemon died. The launchers now export their own pid before forking, the fixtures wait until the subtree's ppid has left that launcher - proving orphaning on plain and subreaper hosts alike - and the recycle assertion now proves the pty-host moved off the dead daemon, which the kernel only does through a reparent.
Owner
|
Speaking as Kun's firstmate: thanks @ardydedase, this is a tightly scoped catch on two host-dependent flakes. I reviewed the tip against main |
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.
Intent
Fix the two pre-existing, host-dependent CI test flakes found during the cancelled PR 6858 auto-fix rounds, both reproducing at origin/main, with no behavior change beyond the two affected surfaces. (1) bin/fm-test-run.sh feeds every comparison from LC_ALL=C sort -u but invokes bare comm, so under a full-collation locale such as the vi_VN host default comm dies with 'input is not in sorted order' and the --check-coverage guard exits red; fix by pinning LC_ALL=C on every comm invocation to match its already-C-sorted feeds. (2) tests/fm-session-lock-ancestry.test.sh fixtures gate readiness on an orphan's ppid becoming 1, which never happens on PR_SET_CHILD_SUBREAPER hosts because the orphan reparents to the subreaper instead, so the bounded wait burns past the fixture's 20s deadline and the suite dies with 'the fixture hook never finished'; fix by having launchers export their own pid before forking and having fixtures wait until the subtree's ppid leaves that launcher, which proves orphaning on plain and subreaper hosts alike, and re-key the recycle assertion to prove the pty-host moved off the dead daemon instead of requiring an init reparent, preserving the test's ancestry-detection semantics. Scope limited to bin/fm-test-run.sh and tests/fm-session-lock-ancestry.test.sh; evidence recorded in state/fm-relaunch-missing-window-gap.status under the 2ef046b section; acceptance: affected suites green locally under both LC_ALL unset and LC_ALL=C, shellcheck clean, CI-green PR delivery.
What Changed
LC_ALL=Con everycomminvocation inbin/fm-test-run.sh(portable-serial listing and all coverage-guard comparisons) socommmatches the collation of its already C-sorted feeds instead of dying with "input is not sorted" under full-collation host locales such asvi_VN.tests/fm-session-lock-ancestry.test.sh: launcher shells now exportFM_FIXTURE_ORPHAN_PARENTwith their own pid before forking, and fixture scripts wait until the subtree's ppid leaves that launcher — proving orphaning on both init-reparenting andPR_SET_CHILD_SUBREAPERhosts — instead of waiting for a ppid of exactly 1.test_e2e_background_session_keeps_its_lock_across_a_recycled_chainto require the pty-host's ppid to move off the dead daemon rather than land on init specifically, and updated the suite's header comments to describe reaper-side ancestry semantics.Risk Assessment
✅ Low: The change is a tightly bounded two-file CI-flake fix that pins every collation-sensitive comparison to the already-pinned C locale and replaces an init-only orphan predicate with an equally strong launcher-pid predicate authorized by the stated intent; no wrong-result or regressional paths were found.
Testing
Reproduced both pre-existing flakes at the base commit on a host that exhibits both conditions (vi_VN full-collation locale for bare comm, and a subreaper ancestor so orphans never reach pid 1), then verified the fixed runner's --check-coverage guard and the fixed ancestry suite are green under LC_ALL unset and LC_ALL=C (plus vi_VN.utf8), with the repo's canonical shellcheck lint clean on the two scoped files; no test failures remain and no actionable findings.
Evidence: Flake 1 reproduction at base commit: bare comm dies under vi_VN full-collation locale
Source: Flake 1 reproduction at base commit: bare comm dies under vi_VN full-collation locale
comm: file 2 is not in sorted order comm: input is not in sorted order EXIT=1Evidence: Fixed runner --check-coverage green under vi_VN.utf8, unset, and C locales
Source: Fixed runner --check-coverage green under vi_VN.utf8, unset, and C locales
FM_TEST_COVERAGE ok total=259 parallel=24 parallel_max_ms=665545 parallel_imbalance_ms=2 parallel_unhinted=0 serial=219 serial_shards=9 serial_unhinted=14 serial_max_ms=1074843 serial_budget_ms=1200000 herdr=16 EXIT=0 (vi_VN.utf8, unset, and C)Evidence: Flake 2 reproduction at base commit on subreaper host (orphans reparent to systemd, not init)
Source: Flake 2 reproduction at base commit on subreaper host (orphans reparent to systemd, not init)
ok - session-lock: a trusted id anchors the lock on the model-loop process, anything else on the outermost pid not ok - the fixture hook never finished EXIT=1Evidence: Fixed ancestry suite green under both LC_ALL unset and LC_ALL=C on the subreaper host
Source: Fixed ancestry suite green under both LC_ALL unset and LC_ALL=C on the subreaper host
ok - session-lock e2e: a background session keeps its lock and its supervision across a recycled helper chain ...all 16 cases ok, EXIT=0 on both runsPipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
✅ **Review** - passed
✅ No issues found.
✅ **Test** - passed
✅ No issues found.
LC_ALL=vi_VN.utf8 bash bin/.repro-fm-test-run-base.sh --check-coverage (base-commit runner via git show 1a6714f) → 'comm: input is not in sorted order', exit 1 (flake 1 reproduced)bash tests/.repro-ancestry-base.test.sh (base-commit test via git show 1a6714f) → fails at first e2e with 'not ok - the fixture hook never finished', exit 1 on this subreaper host (flake 2 reproduced)LC_ALL=vi_VN.utf8 bash bin/fm-test-run.sh --check-coverage → FM_TEST_COVERAGE ok, exit 0bash bin/fm-test-run.sh --check-coverage (LC_ALL unset) → FM_TEST_COVERAGE ok, exit 0LC_ALL=C bash bin/fm-test-run.sh --check-coverage → FM_TEST_COVERAGE ok, exit 0bash tests/fm-session-lock-ancestry.test.sh (LC_ALL unset) → all 16 cases ok, exit 0, ~1m44sLC_ALL=C bash tests/fm-session-lock-ancestry.test.sh → all 16 cases ok, exit 0, ~1m41sbin/fm-lint.sh bin/fm-test-run.sh tests/fm-session-lock-ancestry.test.sh (canonical shellcheck owner, full extended analysis) → exit 0shellcheck diff of both files base vs target → findings byte-identical apart from paths; no new shellcheck findings introducedstate/fm-relaunch-missing-window-gap.status- The intent declares evidence recorded under the 2ef046b section of state/fm-relaunch-missing-window-gap.status, but no such path exists in the worktree or the delivered diff. It is a task-evidence artifact owned by the outer no-mistakes run rather than a repo documentation surface, so this documentation phase neither created nor could verify it.✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.