Repository navigation
test: deflake remote watcher relaunch and worker crash legs in serial 5 shard - #47
Merged
Merged
Conversation
…unch timeout The ordinary-supervision leg of tests/fm-remote-secondmate-lifecycle-e2e.test.sh gave the watcher a fixed 30-second wall clock to probe, relaunch through the guarded remote spawn, wake, and exit, while the watcher itself bounds that relaunch at FM_SECONDMATE_LIVENESS_TIMEOUT (120s). Passing CI legs already ran 30-35 seconds, so a slow runner failed a relaunch the watcher still accepted. Carries upstream kunchenguid/firstmate's fix from 3004ccb (#7518) verbatim: pin the watcher's relaunch timeout and wait that bound plus 30s of probe headroom on SECONDS.
The stale-ownership leg killed only the serving worker child, leaving its
detached restart supervisor and readiness heartbeat loop running. A heartbeat
touch landing after the leg backdated worker.ready made ensure_worker see a
fresh, identity-matching readiness and return before the replacement published
its pid, so worker.pid still held the planted unrelated pid ("the replacement
adopted an unrelated persisted pid").
Kill the worker's isolated process group and wait for it to empty before
planting the stale records, so nothing from the crashed tree can refresh
readiness or republish ownership afterwards.
…on assertion A4. That assertion requires every path that differs from the upstream pin to sit in a PixelOven namespace or on an ADR-approved allowlist. This PR edits two inherited upstream tests, tests/fm-remote-job.test.sh and tests/fm-remote-secondmate-lifecycle-e2e.test.sh, and neither was on the list. The failure comes from this PR's own change. I fixed it the way the repo handled ADR-0023 and ADR-0024: - Added docs/adr/0025-remote-test-timing-deflake.md, with status Proposed so the operator can accept it. It names exactly those two test files and the bounded change each may carry, and says the carry ends when an upstream sync brings an equivalent change. - Added fm-remote-job and fm-remote-secondmate-lifecycle-e2e to the A4 allowlist in .github/workflows/pixeloven-gates.yml. - Brought the copy of the A4 regex in docs/pixeloven/identity.md back in line with the gate. It was already missing fm-pr-merge from ADR-0023, so I added that too, and updated its list of ADR exceptions. - Updated the list of ADR exceptions in docs/pixeloven/fork-contract.md and added an ADR-0025 line. - Added the new ADR to the index in docs/adr/README.md and to docs/documentation-audiences.json. Checked locally: - With the new ADR included, running the gate's own A4 regex against the diff from the pin leaves no paths. - The regex in identity.md is byte-identical to the one in the gate. - The new ADR has no capitalized "Operator", "firstmate" or pixeloven/ URL, so A1–A3 still hold. - bin/fm-doc-audience-check.sh passes, and so does tests/fm-documentation-audiences.test.sh. - The audiences JSON parses. Not done: actionlint isn't installed here, so it wasn't run; the workflow change only adds two names to the regex. The two test files and all product code are unchanged
…serial 5 test fixes Record the operator's decision (option A): the e2e watcher-relaunch hunk is upstream 3004ccb carried byte-identical, and the fm-remote-job crash-fixture hunk is local, to be offered upstream later through the normal path. Each path retires from the A4 allowlist when an upstream synchronization brings it.
This was referenced Nov 2, 2026
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 failing main CI shard "Behavior portable serial 5" through the normal operator delivery path; include before/after flake numbers in the PR. The operator merges.
The failure is tests/fm-remote-secondmate-lifecycle-e2e.test.sh: "not ok - the watcher did not exit on its auto-relaunch wake within the bound: check: secondmate ios auto-relaunched after remote endpoint dead on its configured host (host=remote-mac)". It fails on main pushes 1bd463e (run 40746203515) and ef0565a (run 40564108103), and on PR #43 (run 40761736917, two attempts). Main run 40746203515 also showed "not ok - the replacement adopted an unrelated persisted pid" in the same shard.
Later decision on the PR's fork-contract A4 failure (both changed tests are inherited upstream files): option A. Write a new ADR plus an A4 allowlist entry covering both changes: the upstream e2e watcher hunk carried verbatim (kunchenguid/firstmate 3004ccb), and our local remote-job pid-adoption fix, to be offered upstream later through the normal path (do not publish upstream now). Follow the ADR-0021 shape (Deciders: the operator; self-retiring at the next upstream sync). Keep the PR on its normal delivery path until CI is green; the operator merges.
Before/after flake numbers
Measured by the implementing worker outside the pipeline's test phase (the pipeline's own local run on a loaded macOS host could not reach the changed legs; see Testing below).
pixeloven/operatorCI runsfm-remote-secondmate-lifecycle-e2e.test.sh, Ubuntu 24.04 container, 4 CPUsfm-remote-job.test.sh, Ubuntu containerfm-remote-job.test.shwith one injected readiness touch after the leg backdatesworker.ready(deterministic counterfactual)The containers never reproduced the watcher timeout itself: the leg sits right at the old window (its relaunch has a ~27-28 s floor - an xtrace shows 20 of its 24 s in ~16 sequential remote-job round trips of ~1.25 s each pushing inherited config), so CI's runner variance is what tips it over. That margin, not a watcher regression, is the cause; the watcher's own production bound is 120 s.
Diagnosis:
Fork contract: both test files are inherited upstream paths, so ADR-0025 (accepted by the operator, ADR-0021 shape) lists them on the A4 allowlist until an upstream synchronization brings each change; the e2e hunk is upstream 3004ccb byte-identical, and the fm-remote-job hunk is local, to be offered upstream later.
What Changed
tests/fm-remote-secondmate-lifecycle-e2e.test.sh: carries upstream's watcher auto-relaunch hunk (kunchenguid/firstmate@3004ccb107) unchanged. It setsFM_SECONDMATE_LIVENESS_TIMEOUT=120on the watcher. The test then waits that long plus 30s of wall-clock headroom. Before, it used a fixed loop of about 30s (1500 × 0.02s), which a slow runner could hit even when the watcher would still have accepted the relaunch.tests/fm-remote-job.test.sh: the stale-ownership leg now kills the crashed worker's whole process group, not just the serving child. It waits up to 10s for the group to exit and fails if it doesn't. This stops the restart supervisor and readiness heartbeat from refreshing readiness or republishing ownership after the leg plants its stale records. This fix is local and is not proposed upstream yet.fm-remote-jobandfm-remote-secondmate-lifecycle-e2eto the A4 allowlist in.github/workflows/pixeloven-gates.yml. Updatesdocs/pixeloven/identity.mdso its copy of the A4 regex matches the gate again, which also adds thefm-pr-mergeentry it was missing from ADR-0023. Updates the ADR exception lists inidentity.mdandfork-contract.md, the ADR index, anddocs/documentation-audiences.json. No product scripts change.🤖 Generated with Claude Code
Risk Assessment
✅ Low: The change touches only tests and docs, and the gate edit only adds two names to its allowlist. Both test fixes use the product's own bounds and helpers: FM_SECONDMATE_LIVENESS_TIMEOUT, which bin/fm-watch.sh:375 reads, and fm_remote_job_worker_process_group, which refuses the test shell's own process group. The lines the e2e hunk adds match upstream 3004ccb exactly, and the regex in identity.md matches the one in the gate.
Testing
The Test agent exceeded its invocation budget before live validation completed; no evidence was gathered for this head.
Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
✅ **Review** - passed
✅ No issues found.
✅ **Document** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.