Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion cmd/codeaf/hosted_takeback_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import (
"os"
"os/exec"
"path/filepath"
"runtime"
"slices"
"strings"
"sync"
Expand Down Expand Up @@ -67,7 +68,14 @@ func (m moveRenewals) RenewalChanges() <-chan struct{} { return m.changes }
func newHostedMoveRig(t *testing.T, wrap ...func(http.Handler) http.Handler) *hostedMoveRig {
t.Helper()
cfg, c := doorChat(t)
short, err := os.MkdirTemp("", "cf-move-")
// The workspace host's socket lives under this home. macOS's temporary
// folder leaves it only a few bytes under the socket limit, and none once
// that folder is spelled through /private, so Unix homes start at /tmp.
base := ""
if runtime.GOOS != "windows" {
base = "/tmp"
}
short, err := os.MkdirTemp(base, "cf-move-")
if err != nil {
t.Fatal(err)
}
Expand Down
5 changes: 5 additions & 0 deletions docs/changes/unreleased/2032-sync-engine-fixtures.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
kind: internal
title: Sync fixtures keep their socket homes short on macOS and wait for branch publication
pr: 2032
---
10 changes: 10 additions & 0 deletions internal/syncsetup/drive_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -498,6 +498,16 @@ func TestDriveSideStartsAsViewerWhenHeld(t *testing.T) {
// daemon's socket appearing shows the daemon, and not the spawn, served them.
func TestDriveSidePublishesOverTheDefaultDaemon(t *testing.T) {
r := newDriveRig(t)
if runtime.GOOS != "windows" {
// The rig has not opened an engine transport yet. A short home keeps
// its socket inside the home even with macOS's small address limit.
short, err := os.MkdirTemp("/tmp", "cds")
if err != nil {
t.Fatal(err)
}
t.Cleanup(func() { _ = os.RemoveAll(short) })
t.Setenv(home.EnvVar, short)
}
t.Setenv("CODEAF_ENGINE_DAEMON", "")
r.engine.Transport = nil
t.Cleanup(func() { stopDaemons(t) })
Expand Down
4 changes: 4 additions & 0 deletions internal/syncsetup/twohomes_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -493,6 +493,10 @@ func TestTwoHomesL12DeathBranches(t *testing.T) {

h.block.set(false)
waitFor(t, "A to learn it was superseded", func() bool { _, viewer := a.drive.Viewer(); return viewer })
waitFor(t, "A's branch row to hold three orphan turns", func() bool {
branch, ok := branchRowOf(t, h.a, h.cell.ID)
return ok && branch.OrphanTurns == 3
})

v, err := h.a.Dir.Cell(ctx, h.cell.ID)
if err != nil || v.Cell.Head != parentHead || v.Cell.Lease.Device != h.b.Device.ID() {
Expand Down
Loading