test(core): kill more wire-mesh-transport.ts shutdown/unref mutants - #120
Conversation
…nisms directly Existing shutdown() coverage proves observable, cross-peer behaviour (B sees A's session close, a second decision finds nothing pending) but never asserts on the specific cleanup calls shutdown() itself makes -- so a mutation removing a Map/Set.clear(), a clearTimeout, or a clearInterval call survived undetected whenever the collection it clears happened to already be empty in every existing test. Adds direct spies on Map.prototype.clear/Set.prototype.clear, clearTimeout, clearInterval, and net.Server.prototype.unref (both tls.Server and createTcpTransport's own listeners extend net.Server) to prove each cleanup step runs regardless of what state it starts from, plus a connect_request timeout test asserting the outcome's error code specifically, not just its human-readable message.
|
@codex security review |
Codex Review SummaryThis 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. |
🛡️ Codex Security ReviewSecurity review completed. No security issues were found in this pull request. Reviewed commit: Only the user who started this review can view the report in Codex. ℹ️ About Codex security reviews in GitHubThis is an experimental Codex feature. Security reviews are triggered when:
Once complete, Codex will leave suggestions, or a comment if no findings are found. |
|
🎉 This PR is included in version 2.21.10 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Adds direct mechanism assertions for WireMeshTransport's shutdown()/unref() -- spies on Map/Set.prototype.clear, clearTimeout, clearInterval, and net.Server.prototype.unref to prove each cleanup call actually happens, rather than only the observable cross-peer behaviour existing tests already check.
Targets #114's remaining gap (78.70% baseline, most recent full run 76.85% after the file's own growth, target 80%). Not a complete fix on its own -- this covers the shutdown/unref cluster specifically, which accounted for a large share of the survived mutants in the last full run.