Test fixtures: preserve in-progress pipe reads and control worker-ready transition #151
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Follow-up to #150. Read-only inspection at current main
f40409a6identifies two unsafe/scheduling-sensitive fixture patterns; their responsibility for each historical incident remains unproven.Gated fake workers in GatewayEndToEndReconnectReplayTests.cs (~730) and GatewayEndToEndMultiSubscriberTests.cs (~725) cancel each framed pipe read after 50 ms and retry. WorkerFrameReader consumes length/payload incrementally without cancellation-resume state; cancelling after partial consumption can desynchronize the next frame. Historical replay/age/cap failures (#142/#145/#146/#147) reported Worker pipe disconnected during Invoke/WireUpAdvise before the intended assertions.
SessionManagerTests.InvokeAsync_WhenWorkerHandshakingThenReadyWithinTimeout_Succeeds schedules an unawaited Task.Run/Delay(50) against a 500 ms deadline. Historical #141 reported Handshaking after 616 ms. This supports scheduling sensitivity, not a proven production handshake defect.
Proposed bounded test-only fix: maintain one outstanding read with lifetime cancellation and select against gate signals; use controlled time plus a readiness-start gate and awaited transition task. Preserve replay/cap/age/shutdown assertions. Acceptance: deterministic segmented-frame/gate regression and readiness success/timeout/fault coverage, affected/full portable tests, independent review and green CI. No production protocol change or live operations authorized by this ticket. #150 retains remaining host/resource/checkout and unproven root causes.
Merged PR #153 as
d779daf. Tested commit42c120aa83and merged main have identical source trees. Deterministic segmented-frame regression reproduced the old failure; 54 targeted and 1,196 full Gateway tests passed. Hosted runs 964 and 965 passed portable, Java and Windows x86 jobs; schedule-only nightly was skipped. Independent review found no material defects. Production behavior remains unchanged. #150 retains separate unresolved historical incident investigations.