Repository navigation
test(link): hold the large Child write so the relay overload case holds on Windows - #8670
Conversation
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
✅ Deterministic PR hygiene checks passed. |
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
Review of #8670: the inline wrapper withheld write errors and left callbacks unsettled on teardown. tests/helpers/held-socket-writes.ts gains an idempotent releaseHeldSocketWrites(); errors and socket end/close already settle a held write at once, each callback settles once, and restoreSocketWrites() releases what is still held. The relay case uses the helper. Under the Windows-like eager-write preload dev's case times out and this one passes; relay, traffic and zstd files 64/0 normally and under the preload.
Second review of #8670: release state was shared across holds, so a native completion that arrived after restore and after the next hold began was kept until that later hold released; and a native success after a close-settled write was added to the held set and retained. Each hold now owns its release state, captured by its writes; restore marks it released, so late completions settle at once. Native callbacks after a settlement are ignored. tests/clients/held-socket-writes.test.ts drives the helper with a controllable base write: held-until-release, error and close settle at once, close-then-late-success keeps nothing, completion after restore plus a new hold settles at once. Reverting either fix fails its case.
Third review of #8670: toEqual treats [] and [undefined] as equal, so a withheld success went unnoticed. Assert length and argument; reading the current hold's release state instead of the write's own now fails the late-completion case.
|
Maintainer judgment (dev integration, MAINTAINERS.md maintainer-integration exception): merging without a second maintainer approval, as part of the DEV-RED repair for dev batch run 43369456647 (windows 12/14).
|
Summary
windows 12/14 of dev batch run 43369456647 timed out at 60 s in
tests/clients/link-ws-relay.test.ts:228, "link WebSocket on the Child: an advertising Home > a second Codex message while the first is still unflushed toward the Home closes both legs (1013, 1001)". The case came from #8619 (09f9d43644). It made the first 8 MiB message "unflushed" by pausing the Home's socket. Windows can accept a large send into its socket buffer at once, the same cause #8627 fixed for the link traffic tests, so the write completed and the overload never triggered.The test now holds completion of large
node:netwrites with the sharedtests/helpers/held-socket-writes.tshelper from #8627, which gains an idempotentreleaseHeldSocketWrites(). Write errors and socket end/close settle a held write at once, and each callback settles once. Each hold owns its release state, sorestoreSocketWrites()releases what that hold still holds, and a completion arriving after the restore is never kept by a later hold. A native success after a close-settled write is ignored.tests/clients/held-socket-writes.test.tscovers these orderings deterministically with a controllable base write, and reverting either fix fails its case. The case releases after the 1013 close is observed. It asserts the same close codes (1013 to Codex, 1001 to the Home) and that exactly the first message's length reached the Home. Open #8658 edits this file but does not touch this case. Test-only.Verification
bun test tests/clients/link-ws-relay.test.ts tests/clients/link-traffic.test.ts tests/clients/link-request-zstd.test.ts(all helper users): 64 pass, 0 fail, both normally and under the eager-write preload.bun run typecheck: exit 0.Checklist
Summary by CodeRabbit