From 5f5566f35df81696813e5fc9c41c6c0b91269049 Mon Sep 17 00:00:00 2001 From: hatayama Date: Sat, 18 Jul 2026 14:48:20 +0900 Subject: [PATCH 1/2] Fix stale recovery smoke project setup Copy the source project's runner pin into the temporary Unity project so the dispatcher reaches the intended unreachable-server assertion. Keep the fake harness fixture aligned with the smoke test's required project metadata. --- scripts/smoke-cli-recovery-readiness.go | 22 ++++++++++++++++++-- scripts/test-smoke-cli-recovery-readiness.sh | 2 ++ 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/scripts/smoke-cli-recovery-readiness.go b/scripts/smoke-cli-recovery-readiness.go index d805fb412..c408f235b 100644 --- a/scripts/smoke-cli-recovery-readiness.go +++ b/scripts/smoke-cli-recovery-readiness.go @@ -17,6 +17,7 @@ import ( const ( stateRelativePath = "Temp/UnityCliLoop/server-state.json" + projectRunnerPinPath = ".uloop/project-runner-pin.json" expectedDynamicCodeResult = "cli-recovery-readiness-e2e" e2eDynamicCode = `return "cli-recovery-readiness-e2e";` timeoutExitCode = 124 @@ -61,7 +62,7 @@ func run() error { if err := runLiveRecoverySequence(opts); err != nil { return err } - if err := runStaleRecoveryStateIgnoredSequence(opts.uloopPath, opts.timeout); err != nil { + if err := runStaleRecoveryStateIgnoredSequence(opts.uloopPath, opts.projectPath, opts.timeout); err != nil { return err } @@ -211,7 +212,7 @@ func runLiveRecoverySequence(opts options) error { return assertDynamicCodeResult(dynamicPayload) } -func runStaleRecoveryStateIgnoredSequence(uloopPath string, timeout time.Duration) error { +func runStaleRecoveryStateIgnoredSequence(uloopPath string, sourceProjectPath string, timeout time.Duration) error { projectPath, err := os.MkdirTemp("", "uloop-stale-state-") if err != nil { return err @@ -221,6 +222,9 @@ func runStaleRecoveryStateIgnoredSequence(uloopPath string, timeout time.Duratio if err := createMinimalUnityProject(projectPath); err != nil { return err } + if err := copyProjectRunnerPin(sourceProjectPath, projectPath); err != nil { + return err + } if err := writeStaleServerState(projectPath); err != nil { return err } @@ -244,6 +248,20 @@ func runStaleRecoveryStateIgnoredSequence(uloopPath string, timeout time.Duratio return nil } +func copyProjectRunnerPin(sourceProjectPath string, targetProjectPath string) error { + sourcePath := filepath.Join(sourceProjectPath, filepath.FromSlash(projectRunnerPinPath)) + data, err := os.ReadFile(sourcePath) + if err != nil { + return err + } + + targetPath := filepath.Join(targetProjectPath, filepath.FromSlash(projectRunnerPinPath)) + if err := os.MkdirAll(filepath.Dir(targetPath), 0o755); err != nil { + return err + } + return os.WriteFile(targetPath, data, 0o644) +} + func runUloop(uloopPath string, projectPath string, args []string, timeout time.Duration) commandResult { return runUloopWithEnv(uloopPath, projectPath, args, timeout, nil) } diff --git a/scripts/test-smoke-cli-recovery-readiness.sh b/scripts/test-smoke-cli-recovery-readiness.sh index d7adab044..c90f6adb2 100755 --- a/scripts/test-smoke-cli-recovery-readiness.sh +++ b/scripts/test-smoke-cli-recovery-readiness.sh @@ -22,6 +22,8 @@ cleanup() { trap cleanup EXIT INT TERM mkdir -p "$PROJECT_PATH/Assets" "$PROJECT_PATH/ProjectSettings" +mkdir -p "$PROJECT_PATH/.uloop" +cp "$ROOT_DIR/.uloop/project-runner-pin.json" "$PROJECT_PATH/.uloop/project-runner-pin.json" cat > "$FAKE_ULOOP_SOURCE" <<'EOF' package main From b8ea9b2729e04d2fa9eeeeb394e117f9745e3ca5 Mon Sep 17 00:00:00 2001 From: hatayama Date: Sat, 18 Jul 2026 14:56:24 +0900 Subject: [PATCH 2/2] Document the runner pin smoke-test precondition Explain why the temporary project must receive the runner pin before the stale recovery assertion runs, so the dispatcher reaches the intended connection failure path. --- scripts/smoke-cli-recovery-readiness.go | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/smoke-cli-recovery-readiness.go b/scripts/smoke-cli-recovery-readiness.go index c408f235b..21de34875 100644 --- a/scripts/smoke-cli-recovery-readiness.go +++ b/scripts/smoke-cli-recovery-readiness.go @@ -222,6 +222,7 @@ func runStaleRecoveryStateIgnoredSequence(uloopPath string, sourceProjectPath st if err := createMinimalUnityProject(projectPath); err != nil { return err } + // Why: the dispatcher requires the runner pin before this sequence can reach the connection failure assertion. if err := copyProjectRunnerPin(sourceProjectPath, projectPath); err != nil { return err }