Skip to content

test(core): kill more wire-mesh-transport.ts shutdown/unref mutants - #120

Merged
Mearman merged 1 commit into
mainfrom
chore/mutation-wire-mesh-transport-p2
Sep 15, 2026
Merged

Mearman merged 1 commit into
mainfrom
chore/mutation-wire-mesh-transport-p2

Conversation

@Mearman

@Mearman Mearman commented Sep 15, 2026

Copy link
Copy Markdown
Member

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.

…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.
@Mearman
Mearman marked this pull request as ready for review September 15, 2026 02:09
@Mearman

Mearman commented Sep 15, 2026

Copy link
Copy Markdown
Member Author

@codex security review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 15, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
🔒 Security Review Completed 2026-09-15T02:12:47.892738Z 17e403d Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

🛡️ Codex Security Review

Security review completed. No security issues were found in this pull request.

Reviewed commit: 17e403de8d

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

@Mearman
Mearman merged commit 629cc8c into main Sep 15, 2026
6 checks passed
@Mearman
Mearman deleted the chore/mutation-wire-mesh-transport-p2 branch September 15, 2026 02:35
@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 2.21.10 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant