Repository navigation
test(mecatui): replace lifecycle sleeps with observed barriers - #2630
Merged
Merged
Conversation
This was referenced Oct 31, 2026
Wait for retired notifier completion and actual command startup before lifecycle assertions. Prevent the invocation deadline from masking broken replacement cancellation. Co-authored-by: Mecatl <[email protected]>
Hold cancelled rendering beyond debounce readiness under synctest. Use an independent descendant-owned FIFO to verify process-group cancellation cannot be masked by WaitDelay, with a cleanup release path for orphaned fixtures. Co-authored-by: Mecatl <[email protected]>
jbeda
force-pushed
the
test/lifecycle-flake-barriers
branch
from
October 31, 2026 19:50
2993329 to
f22359d
Compare
jbeda
enabled auto-merge (squash)
October 31, 2026 19:53
10 of 14 tasks
Merged
2 tasks
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.
Summary
Replace two sleep-based lifecycle-test assumptions with observed barriers:
testing/synctesttest holds a cancelled renderer past replacement debounce readiness, settles the goroutines, and proves replacement work cannot start until the predecessor returns. Release then proves replacement progress and latest-result publication.WaitDelay. A second FIFO releases even an orphaned descendant during failure cleanup, without PID probes or survival sleeps.These address the two remaining hardening candidates in the local handoff. Neither was reproduced as a current CI flake. This is test hardening only, not a claim that a newly reproduced production or CI failure is fixed. Related flake tracker: #2327; this PR does not close it.
Why
The hook test's 200ms sleep could allow a negative assertion before retired-worker activity settled. It now waits on actual worker completion.
The status test's 300ms sleep could let submissions coalesce before the first command started. Its one-second invocation timeout could also rescue broken replacement cancellation. The real-process test now observes descendant startup and disables that independent invocation deadline.
The initial panel found two further coverage gaps: debounce could mask missing render serialization, and stdout
WaitDelaycould mask a surviving descendant. Both are resolved by the split fake-time serialization test and independent descendant-owned FIFO EOF assertion.Verification
All passed locally on the revised change:
task test(1800-second outer bound)task lint(600-second outer bound; zero issues across all modules)task test:race(1800-second outer bound)go run ./cmd/mecademo— tool call, permission ask/approval, and final result observedgit diff --checkFocused stress: 150 race-enabled executions each of the new serialization test and revised real-process test across CPU settings 1, 2, and 4:
The unchanged agent-hook hardening also passed 150 race executions across those CPU settings during the initial verification.
Mutation checks
New mutations directly exercise the two panel findings; all production edits were restored before the revised full gates:
replacement "latest" started before the first renderer joined.procgroup.Configurewhile retainingWaitDelay: the real-process test reaches replacement publication but fails on the independent FIFO read withdescendant retained its pipe after cancellation. Failure cleanup releases the orphan.The initial version also detected removal of replacement cancellation, stale-generation filtering, and revoked-worker delivery suppression. Those initial results are supplementary; the two checks above were run against the revised tests.
Panel review
Re-reviewed the complete four-file diff against original base
cca18a37e48ba95a9003fb993c3ce8eb360a01ae, including the authorized follow-up fixes:PANEL: ship_blockers=0 important=0 advisory=0 reviewer_failures=0API compatibility
No wire, Go-source API, stored-data, or runtime behavior changes: only test fixtures and assertions change. No API major bump, feature identifier, client changes, or upgrade steps are required. The real FIFO/process test is Unix-scoped; the deterministic serialization test is platform-independent.