diff --git a/docs/changes/unreleased/1703-standing-isolation-macos-root.md b/docs/changes/unreleased/1703-standing-isolation-macos-root.md new file mode 100644 index 0000000000..a237be0dcd --- /dev/null +++ b/docs/changes/unreleased/1703-standing-isolation-macos-root.md @@ -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. diff --git a/internal/session/standing_isolation_test.go b/internal/session/standing_isolation_test.go index 8a30670d37..2ad1e2c80e 100644 --- a/internal/session/standing_isolation_test.go +++ b/internal/session/standing_isolation_test.go @@ -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 {