Skip to content

fix(mcpx): bind stale-socket tests in testsupport.SocketDir (#237) - #8254

Merged
dezren39 merged 1 commit into
mainfrom
fix/237-mcpx-stale-socket-darwin
Nov 10, 2026
Merged

dezren39 merged 1 commit into
mainfrom
fix/237-mcpx-stale-socket-darwin

Conversation

@dezren39

@dezren39 dezren39 commented Nov 10, 2026 •

Copy link
Copy Markdown
Member

Part of #237 (mcpx darwin portability). Found by the aarch64-darwin verification run for dezren39/darwin-nix#1770 / #471.

Failure (real macos-15 runner, nix build .#packages.aarch64-darwin.mcpx at code f2223b6d):

--- FAIL: TestClearStaleSocketPreservesSymlinkToStaleSocket (0.00s)
    stale_socket_test.go:81: listen unix /nix/var/nix/builds/nix-3336-3473794416/TestClearStaleSocketPreservesSymlinkToStaleSocket2391851832/001/stale.sock: bind: invalid argument
--- FAIL: TestClearStaleSocketRemovesStaleSocket (0.00s)
--- FAIL: TestClearStaleSocketProtectsActiveSocket (0.00s)
FAIL github.com/developing-today/code/pkgs/mcpx/internal/daemon

Cause: the three clearStaleSocket tests that bind a socket use t.TempDir() directly. Under a nix build, TMPDIR is the long build dir, so the socket path exceeds Darwin's 100-byte sun_path ceiling and bind returns EINVAL. The product code is not involved — this is the exact failure testsupport.SocketDir was written to prevent (#434); the #5742 tests missed it.

Fix: use testsupport.SocketDir(t) for the socket-bearing directories in those three tests. No product code changed, no test skipped — the tests now run on darwin too.

Verification:

  • Reproduced the darwin failure on Linux with a deep TMPDIR: old code fails the same three tests with the same bind: invalid argument; fixed code passes.
  • All six TestClearStaleSocket* pass; full internal/daemon suite passes (ok ... 91.9s on a loaded machine).
  • GOOS=darwin GOARCH=arm64 go vet ./internal/daemon ./internal/testsupport clean.

After this merges, dezren39/darwin-nix PR #1775 re-pins mcpx-src to the merge rev and re-runs its Linux + macos-15 darwin build verification.


Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

The three clearStaleSocket tests that bind a unix socket used t.TempDir() directly. Under a nix build TMPDIR the socket path exceeds Darwin's 100-byte sun_path ceiling and bind fails with EINVAL, failing the aarch64-darwin mcpx build (dezren39/darwin-nix#1770, #471) even though the product code is fine. testsupport.SocketDir exists for exactly this (#434); use it, like every other socket-binding test. Reproduced the darwin failure on Linux with a deep TMPDIR (same three tests, same bind error); all six TestClearStaleSocket* pass with the fix, full internal/daemon suite passes.
@dezren39
dezren39 requested a review from a team as a code owner November 10, 2026 20:47
@chatgpt-codex-connector

Copy link
Copy Markdown
Codex Review Summary: ❌ Failed

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

Review Status Commit Review trigger
📝 Code Review ❌ Failed 2026-11-10T20:47:04.724746Z
We couldn’t complete this review. Comment @codex review to try again.
a895c21 PR opened
ℹ️ 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.

@coderabbitai

coderabbitai Bot commented Nov 10, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 53 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: ae82262f-7ebe-4934-9fd0-c8496a4ad0ed
Commits

Reviewing files that changed from the base of the PR and between 1ec4d74 and a895c21.

Files selected for processing: 1

  • pkgs/mcpx/internal/daemon/stale_socket_test.go
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@dezren39
dezren39 merged commit f8957ac into main Nov 10, 2026
3 of 17 checks passed
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant