Skip to content

tests: the last Mac assumptions in cellstore's socket fixtures and remote's stamp answers - #2047

Merged
AbirAbbas merged 2 commits into
app/v3from
test/mac-test-assumptions
Nov 3, 2026
Merged

AbirAbbas merged 2 commits into
app/v3from
test/mac-test-assumptions

Conversation

@AbirAbbas

Copy link
Copy Markdown
Collaborator

Depends on #2033. This branch sits on #2033's four commits, rebased onto app/v3 bd98788a9. The commits before tests: the last test-only Mac assumptions (T3-T7) are #2033's and drop out when #2033 lands; this PR then rebases onto app/v3. Its own change is that one commit: 10 *_test.go files, nothing else.

What and why

On a Mac (macOS 15.6, arm64, Apple's /bin/bash 3.2, BSD userland), twelve tests fail with nothing wrong in the product: they assume Linux. With #2033 (canonical temporary roots) and this PR, those twelve pass on the Mac, so the Mac go test gate is left with only the failures that have their own owners (below).

class test cause on a Mac fix (test only)
T3 session TestOwnershipChatRoutesScratchWithoutMovingTheProject, TestOwnedBeltWorkerUsesRealScratchWithoutChangingHome, TestExplicitInPlaceWorkerRoutesScratchWithoutOwningTheProject, TestLegacyOwnedWorkerUsesItsAdmittedRuntime; executor TestWorkspaceEnvironmentRoutesRealTemporaryFilesThroughBothRunnerDoors BSD mktemp without a template ignores TMPDIR (it asks confstr(_CS_DARWIN_USER_TEMP_DIR)) the probe names "${TMPDIR:-/tmp}/probe.XXXXXX"; every placement, ownership and file-existence assertion stays
T4 cellstore TestR9UnixShortSocketOrder, TestR9UnixShortSocketRejectsPreclaimedDirectory, TestSocketIsKeyedToTheEngineBinary /tmp is a link to /private/tmp, and the product names a home by its physical path; os.TempDir() may end in /; the long Mac TMPDIR passes the 104-byte sun_path and selects the hashed fallback fixtures resolve the home, clean the prefix and use a short base; the security subtests and the per-build socket separation stay
T5 release TestTheReleaseSurfaceTestSurvivesEveryLedgerState the test's own printf probe expands an empty array, which bash 3.2 calls unset under set -u the probe guards the expansion; release.yml (run on ubuntu-latest) is unchanged
T6 remote TestTheTeamsDoorsCrossFromTheEnginesProfile "an unchanged answer is ≤ 64 bytes": a Mac's 8-digit device and inode numbers make the stamp 65 the unchanged answer must be exactly the held stamp and same:true (and the quiet Traffic answer exactly the stamp)
T7 tui3 TestEveryEmptyPlaceDrawsItsHeadingAndOneWhisper, TestEveryPlaceWhisperWrapsLikeHomesAndIsNeverCut the Memory switch is drawn opt+u on a Mac, by design the expected line is spelled through the app's own chord spelling

A macOS limit worth knowing (not changed here): the T3 tests now prove that a tool which honours TMPDIR writes into chat scratch, which holds on both systems. A tool calling bare mktemp on a Mac still writes to the per-user folder instead, because BSD mktemp ignores TMPDIR. The product sets the environment; it doesn't contain the filesystem (internal/executor/environment.go). If ordinary temporary tools are expected to land in chat scratch on a Mac, that is a product question for its own issue, not a test fix.

Before / after (macOS, the six packages one by one)

Each package run on its own (go test -count=1 -p 2), on app/v3 bd98788a9 + #2033 (before) and with this commit (after):

package T3–T7 tests failing before after what still fails there (not this PR's)
executor 1 (T3) 0 R4 process groups (#2039): TestAShellCallTellsTheObserverWhatItLeftRunning, TestLocalRecordsAListeningServiceFully
release 1 (T5) 0 red on Linux CI too: TestC16PromotionTriggerAndCutoff, TestPromotionWorkflowExplainsItsSafetyLaws
remote 1 (T6) 0 none: package passes
tui3 2 (T7) 0 TestRemovedComputerReopensWithTheSameProjectLabel/project: caused by #2033, fixed there
cellstore 3 (T4) 0 none: package passes
session 4 (T3) 0 R2 provenance (#2036), R3 Apple Git (#2035), and tests red on Linux CI too

All 12 tests go from fail to pass. Four session tests failed after but not before: TestAKeyedRunRowNoteWhoseCommitFailsIsUnknown, TestAPersonNoteKeepsOnlyValidClientIDsAcrossBothStores, TestARefusedRunRowNoteStoresNoKey, TestARunRowNoteKeepsItsClientIDInTheStoreAndTheReadStepJoinsOnTheNoteID. Each says "TempDir RemoveAll cleanup: … directory not empty", and rerun ×5 they fail on the base too (2/5 each) and here (1–4/5). That's a pre-existing Mac flake in files this PR doesn't touch. TestTheSourceHoldsEveryRowTheAppLists is the same class (3/5 on the base).

Full go test -count=1 -p 6 -timeout 15m ./... on the Mac (app/v3 + #2033, before vs after)

Queued in the gate lane (base, then this branch). Compared by failing test name when it lands.

Scope

Only *_test.go in internal/session, executor, cellstore, release, remote and tui3. No product file, workflow, Makefile or ci-full.yml change; no GOTMPDIR.

Review

Independent Codex review: clean (no blocker, major or minor beyond the T3 disclosure above, which this body makes). One nit kept: the T6 assertion compares the exact marshalled frame. Go marshals a struct's fields in a fixed order, and a new field in the "unchanged" answer should make someone revisit that contract.

🤖 Generated with Claude Code

AbirAbbas added a commit that referenced this pull request Oct 29, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@AbirAbbas
AbirAbbas force-pushed the test/mac-test-assumptions branch from 9175b91 to 0ab9cc1 Compare October 29, 2026 23:18
AbirAbbas added a commit that referenced this pull request Oct 29, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@AbirAbbas

Copy link
Copy Markdown
Collaborator Author

Closing unmerged: the Mac push stopped early to save usage. What this fixes and what is left is tracked in #2061. The branch test/mac-test-assumptions is kept.

AbirAbbas and others added 2 commits November 2, 2026 18:33
Twelve tests assumed Linux and failed on a Mac with nothing wrong in the
product:
- BSD mktemp ignores TMPDIR without a template, so the five scratch-routing
  probes now name "${TMPDIR:-/tmp}/probe.XXXXXX" (session, executor);
- the three cellstore socket fixtures resolve /tmp to /private/tmp, clean
  the temp prefix and keep a short base, as the product's socket rules do;
- the release-surface probe guards an empty array, which bash 3.2 calls
  unset under nounset (the workflow itself runs on Linux bash);
- the teams doors' unchanged answer is asserted to carry exactly the stamp
  and the flag, since a Mac's device and inode numbers make the stamp longer;
- tui3's Memory switch is expected in the app's own chord spelling, which
  is opt+u on a Mac.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@AbirAbbas AbirAbbas reopened this Nov 2, 2026
@AbirAbbas
AbirAbbas force-pushed the test/mac-test-assumptions branch from 0ab9cc1 to a8360ac Compare November 2, 2026 23:38
@AbirAbbas
AbirAbbas marked this pull request as ready for review November 3, 2026 00:27
@AbirAbbas AbirAbbas changed the title tests: the last test-only Mac assumptions (T3-T7) tests: the last Mac assumptions in cellstore's socket fixtures and remote's stamp answers Nov 3, 2026
@AbirAbbas
AbirAbbas merged commit f7714ed into app/v3 Nov 3, 2026
14 of 20 checks passed
@AbirAbbas
AbirAbbas deleted the test/mac-test-assumptions branch November 3, 2026 00:27
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