Skip to content

Fix Go GOWORK test failing on macOS nightly - #1894

Open
Mikola Lysenko (mikolalysenko) wants to merge 1 commit into
mainfrom
ci-janitor/go-gowork-symlinked-tmp
Open

Mikola Lysenko (mikolalysenko) wants to merge 1 commit into
mainfrom
ci-janitor/go-gowork-symlinked-tmp

Conversation

@mikolalysenko

@mikolalysenko Mikola Lysenko (mikolalysenko) commented Oct 30, 2026 •

Copy link
Copy Markdown
Collaborator

Problem

The nightly CI run on main (41009903891) failed test (macos-latest, 2) with -p socket-patch-cli --test e2e_golang_workspace_build. It is the first nightly after #1812 (merged 2026-10-29 13:24 UTC), which added apply_never_writes_go_work_when_gowork_names_a_sibling_file. The 10-29 nightly passed on macOS. The test is deterministic, so every nightly will fail until it's fixed. Nightly CI on main has been red for 8 days in a row; the other failing leg (Windows crawler_maven_e2e) is handled by #1852.

Root cause

The test sets GOWORK to <tempdir>/ws/ci.work and then runs go run ./a with its working directory set inside that tempdir. go reads its working directory with symlinks resolved. On macOS the tempdir is under /var, which is a symlink to /private/var, so go sees the member at /private/var/... and the workspace at /var/.... It refuses the member:

directory a is contained in a module that is not one of the workspace modules listed in go.work.

This is a test harness problem. socket-patch's own checks (same_dir_key) already canonicalize paths. Linux PR and merge-queue legs never caught it because their tempdir has no symlink.

Fix

On Unix, stage this test under the canonicalized tempdir. Windows keeps the plain path, because canonicalize there returns a \\?\ path that go can't use. The Windows leg passes today.

Proof

Reproduced on Linux by pointing TMPDIR at a symlink, which mimics macOS:

TMPDIR symlinked plain TMPDIR
before (main) FAILED 2/2, same go error ok
after ok 5/5, plus the full file 31/31 ok

rustfmt --check is clean on the touched file. cargo clippy --test e2e_golang_workspace_build reports no findings in this file. The only findings are pre-existing ones in tests/prebuilt_common/mod.rs, and main has the same ones on the local 1.93 toolchain.

No tests were removed or moved.


Generated by Claude Code


Note

Low Risk
Test-only harness change in one e2e; no production code paths modified.

Overview
Fixes macOS nightly failures in apply_never_writes_go_work_when_gowork_names_a_sibling_file by staging the workspace under a canonical temp path on Unix instead of the raw tempfile path.

The test sets GOWORK to a sibling ci.work and runs go from member dirs; Go resolves the working directory through symlinks, so on macOS (/var → /private/var) the workspace file and member paths no longer matched and go run failed. Windows is unchanged—still uses the non-canonical path because canonicalize yields \\?\ paths Go rejects.

Staging and run_member now use this base path; assertions and product behavior under test are the same.

Reviewed by Cursor Bugbot for commit 15cf91e. Configure here.


Generated by Claude Code

The nightly macOS test leg has failed since #1812 added
apply_never_writes_go_work_when_gowork_names_a_sibling_file. The test
sets GOWORK to a file under the tempdir and then runs go in a member.
go takes its working directory with symlinks resolved, so on macOS
(/var -> /private/var) the member sits outside the workspace GOWORK
names and go refuses it: "directory a is contained in a module that
is not one of the workspace modules listed in go.work".

Stage the test under the canonical tempdir on Unix. Windows keeps the
plain path, where canonicalize would give a \\?\ path go can't use.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011f9aeT7Z8SgtvNfjPY7zCb
@mikolalysenko Mikola Lysenko (mikolalysenko) added the ci-janitor Opened by the CI janitor routine (flakes, redundant tests, CI perf) label Oct 30, 2026
@mikolalysenko

Copy link
Copy Markdown
Collaborator Author

bugbot run


Generated by Claude Code

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit 15cf91e. Configure here.

@mikolalysenko Mikola Lysenko (mikolalysenko) added the Ready for review Agent-verified: mergeable, CI green, Bugbot clean — awaiting human review label Oct 30, 2026
@mikolalysenko

Copy link
Copy Markdown
Collaborator Author

[burn-down agent] Labeled Ready for review at 15cf91e.

  • CI: 50/50 checks green on 15cf91e; mergeable.
  • Bugbot: reviewed 15cf91e, no findings.
  • Reviewer note: test-only fix; canonicalizes the macOS tempdir so GOWORK matches the cwd Go resolves through /var. Should clear the e2e_golang_workspace_build failure on main's macOS nightly.

Generated by Claude Code

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

Labels

ci-janitor Opened by the CI janitor routine (flakes, redundant tests, CI perf) Ready for review Agent-verified: mergeable, CI green, Bugbot clean — awaiting human review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants