Skip to content

tests: sync fixtures keep their socket homes short on macOS and wait for branch publication - #2032

Merged
AbirAbbas merged 1 commit into
app/v3from
test/sync-fixtures-real-engine
Nov 3, 2026
Merged

AbirAbbas merged 1 commit into
app/v3from
test/sync-fixtures-real-engine

Conversation

@AbirAbbas

@AbirAbbas AbirAbbas commented Oct 29, 2026 •

Copy link
Copy Markdown
Collaborator

Why

Fourteen sync and take-back tests failed on every run on a Mac (macOS 15.6, Apple M4 Pro, Go 1.26.5) and look green on Linux CI. They are green there because they skip: the CI jobs stage no furrow, so celltest.RequireEngine and newDriveRig skip every engine-backed sync test. The Mac has furrow staged, so they run there. Since the publication gate started requiring a conversation message (#2009), nobody saw these fixtures go stale.

Each failure was read against the product code, and the cause was confirmed with a single-test run on the Mac. Eleven of the fourteen are fixture or assertion defects, and this PR repairs them. It changes no product file.

Test Cause Repair
TestScriptedSessionCosts, TestDriveSidePublishesOverTheDefaultDaemon, TestKeepsSnapshotIDs, TestRotatedShowsWaitOnce (and TestScriptedSessionTailSealCosts) chat.say wrote a file but no conversation message, so Drive.note never queued the turn for publication chat.say appends one assistant message, as openChat.say already does
TestDriveSidePublishesOverTheDefaultDaemon on macOS the long test home pushes socketFor to its short private alias, so the in-home socket glob (and stopDaemons) found nothing the test gets a short home under /tmp, so its socket stays in the home on every Unix (the #411 precedent)
TestScopesCountsEveryRelayRequest, TestTwoHomesL12DeathBranches, TestTwoHomesTakeARunningChatAtOnce, TestDriveSideSupersededStopsTools Batcher.publish fences the window (OnLost, viewer) before it uploads the branch, so "viewer" came too early to check the branch keep the viewer wait, then wait (bounded) for the branch row with its exact orphan count, or for the kept-work notice
TestHostedTakeBackReachesAcquireWithoutSharedUploadsOrReleaseDelay reopening an unchanged own hold heartbeats instead of acquiring (driving, pinned by TestFenceF1StartupRenewsExistingHold), so the test's "2 acquires" can't happen assert fence continuity: the relay hold is A's at the take's acquired fence, and the reopened writer's accepted heartbeat at that fence comes within 5 s of the acquire (the old gap bound)
TestKilledComputerTakesBackFromHomeAndLocalCard/home it waited for a literal alt+c, but macOS draws the chord as opt+c by design a test-local helper spells the chord the way internal/tui3/chords.go does for runtime.GOOS
TestAppTakeC1bSavedModelTravelsBack (both subtests) A saves its first turn in two publications at the same fence. Measured: B's first eligible row named head 59e7…, and 500 ms later both computers reported d613…. A take that names the earlier head is correctly refused by LeaseExpectation.Matches ("another device continued this chat first") the first take waits for a head both computers report twice, as the test's own take back already did

Not in this PR:

  • TestWatchDisplacementRetiresTheDriveHoldImmediately/higher_local_fence is a real product defect. Its fix is in the companion draft PR "syncsetup: a window displaced by a newer hold on the same computer lets go at once".
  • TestPublicTakeRestoresEveryWorkspaceSetRoot and TestPublicForkKeepsLiteralLinksWithoutCitingTheirTargets need a product decision, so they are reported rather than patched over. With a physical TMPDIR they get past the compose step and fail with furrow's snapshot … is not held in this store. A diagnostic run showed that the missing snapshot is the restored .cell/published.json head, which the snapshot carries from the sender. It names the sender's older turn: 3806566f…, against the received head eca615c2… recorded in adopted.json. sharedBoundary (internal/cellstore/localwork.go:82) prefers that file, and SyncEngine.Materialize (internal/cellstore/syncops.go:258) records only adopted.json. A completed public take repairs this through NotePublished (take.go:284). A take retried on an already-restored tree, or a direct fetch, does not. The likely fix is a NotePublished(c, head) right after noteAdopted in Materialize. That is a product change, so it is left out of this test-only PR.

How it was checked

Every run was on the Mac with furrow staged (go test -count=1 -p 2 -v, niced, one package at a time):

app/v3 12dadd6 this branch
the 14 tests 14 fail the 11 fixture cases pass. Three still fail: the product defect fixed by #2034, and the two snapshot tests reported above. With #2034 as well, 12 of 14 pass
./internal/syncsetup (whole package) 11 + 7 TMPDIR-class failures its 8 fixture tests fixed, plus TestScriptedSessionTailSealCosts. Two learner tests (TestR26R27C30…, TestR9R23…) timed out once under machine load (load average 18) and pass alone; the rest are the TMPDIR class, handled by the separate draft "tests: fixtures get the physical temporary folder on macOS"
  • go vet passes for ./internal/syncsetup ./cmd/codeaf, both darwin and GOOS=linux. gofmt is clean.
  • Rig home under /tmp (third commit). A combined run with tests: fixtures get the physical temporary folder on macOS #2033 (physical TMPDIR) showed the hosted move rig's workspace-host socket no longer fit under macOS's 104-byte limit, so both hosted take-back tests timed out "waiting for host socket". The rig's home now starts at /tmp on Unix. Both tests pass on this Mac with the ordinary TMPDIR and with a physical one.
  • On the current app/v3 (1c4ec8a, after pair: merge a computer's own chats when it joins, instead of replacing them #2031), a local merge of this branch with tests: fixtures get the physical temporary folder on macOS #2033 and the rebased syncsetup: a window displaced by a newer hold on the same computer lets go at once #2034 merges cleanly:
    • 12 of the 14 pass. The two snapshot tests reported above still fail.
    • All 101 TMPDIR-class tests pass.
  • CI, dispatched and judged by content against the app/v3 runs on 12dadd6 (PR gate 40925411112, Full check 40925415150):
    • PR gate at 36b59e5: the light-gate failures are the same tests with the same messages as app/v3's (commentlaw, guard, the session ending ceilings, taxonomy). "touched codeaf" and "touched packages" pass.
    • Full check at 36b59e5: no failures beyond app/v3's 28; one app/v3 failure passed.
    • The first Full check (c73abdd) had two extra failures, TestR7PersonalLeaderFallbackAndNoAutomaticRegain and TestAppOrdinaryClientIDSurvivesABackendRestart, in code this PR doesn't touch. Both passed on its rerun of the failed shards, and 3/3 on this Mac. That rerun's only extra was the known flake TestFactoryAssigneesRunnerPublishesTeamAndSolo.
  • The Mac full-tree gate is below.

Codex adversarial review: two rounds.

  • Round 1 found that the receipt the take writes cannot prove the hosted writer reopened, and that the release-delay gap loop had become vacuous. Both are fixed in the second commit, which records accepted heartbeats.
  • Two minor findings are left as they were:
    • The two-sample head heuristic is shared with the test's existing take-back block.
    • The default-daemon test's socket check is inherited and doesn't prove that every publication verb used the daemon. This is a possible follow-up.
  • Round 2 had no findings.
  • A round-3 review of the late delta (the rig home and the entry number) also had no findings.

Not verified: Linux with furrow staged, because CI does not stage it. Staging furrow in the full-tests job is recommended so these tests stop skipping. That workflow is not changed here.

Manual verification: none. This PR changes only tests; there is no app behaviour to exercise.


🤖 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 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/sync-fixtures-real-engine branch from 36b59e5 to 2bcc4c6 Compare October 29, 2026 23:19
@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 #2049. The branch test/sync-fixtures-real-engine is kept.

…for branch publication

Rebased onto app/v3, where #2178 and #2183 already cover most of this
branch: the engine-backed fixtures and the hosted take-back's resumed-hold
proof. What is left:

- the hosted move rig and the drive rig's default daemon keep their homes
  under /tmp on Unix, because macOS's temporary folder leaves a workspace
  socket only a few bytes under the address limit;
- the L12 death-branches test waits for A's branch row to hold its three
  orphan turns before it reads them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@AbirAbbas AbirAbbas reopened this Nov 2, 2026
@AbirAbbas
AbirAbbas force-pushed the test/sync-fixtures-real-engine branch from 2bcc4c6 to b02d75b Compare November 2, 2026 23:37
@AbirAbbas AbirAbbas changed the title tests: the engine-backed sync fixtures speak, wait for their branches, and read the Mac chord tests: sync fixtures keep their socket homes short on macOS and wait for branch publication Nov 2, 2026
@AbirAbbas
AbirAbbas marked this pull request as ready for review November 3, 2026 01:01
@AbirAbbas
AbirAbbas merged commit e1a3692 into app/v3 Nov 3, 2026
23 of 41 checks passed
@AbirAbbas
AbirAbbas deleted the test/sync-fixtures-real-engine branch November 3, 2026 01:01
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