Skip to content
Closed
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: 10 additions & 0 deletions docs/changes/unreleased/1703-standing-isolation-macos-root.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
kind: fixed
title: the standing isolation test compares the canonical repository root, so it passes on macOS
pr: 1703
surface: [engine]
invalidates: []
---

The recorded root was right all along; the test compared it with the raw temp
directory, which macOS spells through the /var to /private/var symlink.
6 changes: 5 additions & 1 deletion internal/session/standing_isolation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,12 @@ func TestStandingIsolationRecordsItsCopyBeforeWorkerInitialization(t *testing.T)
if _, err := runner.Run(context.Background(), item, runDir, ""); !errors.Is(err, want) {
t.Fatalf("initialization error changed: %v", err)
}
// The record keeps the repository's canonical root ([repositoryRoot]), so
// the comparison resolves symlinks too: on macOS t.TempDir() answers under
// /var/folders while the same directory's canonical spelling is under
// /private/var/folders, and a raw comparison fails a correct record.
trees := loadStandingTrees(runDir)
if len(trees) != 1 || trees[0].Root != repo || trees[0].Home == "" || trees[0].HomeSha == "" {
if len(trees) != 1 || trees[0].Root != canonicalPath(repo) || trees[0].Home == "" || trees[0].HomeSha == "" {
t.Fatalf("lost recovery identity: %+v", trees)
}
if got := currentBranch(trees[0].Dir); got != trees[0].Branch {
Expand Down
Loading