Skip to content

fix: Timed-out Unity process lookups on Windows now report a timeout instead of a bare exit status - #3029

Merged
hatayama merged 1 commit into
mainfrom
fix/windows-process-list-timeout-message
Sep 29, 2026
Merged

hatayama merged 1 commit into
mainfrom
fix/windows-process-list-timeout-message

Conversation

@hatayama

@hatayama hatayama commented Sep 28, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • On Windows, when looking up running Unity Editors takes longer than its 10-second limit, the CLI now says the lookup timed out instead of reporting a bare exit status 1.

User Impact

  • Before: commands that check for a running Unity Editor on Windows (for example uloop launch) could fail with only failed to retrieve Unity process list on Windows: exit status 1. A slow PowerShell or WMI start and a genuinely failing script looked identical, so there was no way to tell whether to wait, retry, or investigate.
  • After: a lookup stopped by its limit reports listing Unity processes on Windows timed out after 10s; PowerShell or WMI did not respond, retry the command. A lookup whose script fails on its own now includes PowerShell's error output.
  • The 10-second limit is unchanged. Now that the timeout is named, a slow cold start costs one retry; raising the limit would make every genuine WMI stall wait longer.

Changes

  • The Windows process-list command reports its own timeout explicitly, and only when its own limit stopped it. A caller whose earlier deadline or cancellation came first still reports that itself.
  • Script failures carry PowerShell's stderr.
  • The command run takes its timeout as a parameter, as the focus helpers already do, so tests can reach the timeout path quickly. The stderr helper moves from the macOS-only focus file into the shared error helpers.
  • The shared-inputs stamps are refreshed, because the change is under cli/common. release-please therefore attributes it to both the dispatcher and the project runner.

Verification

  • New tests in cli/common/unityprocess cover the timeout message, a caller deadline that must not be reported as the list timeout, stderr on script failure, and successful output. They were written first and failed against the old behavior, except for the two guard cases. Dropping the caller-deadline guard makes its test fail.
  • These tests run a stand-in command (sleep / sh) through the same helper on macOS. The real PowerShell path on Windows was not run locally.
  • gofmt, go vet (also with GOOS=windows and GOOS=linux), golangci-lint, go test for all four Go modules, cross-builds of the dispatcher and project runner for windows/linux/darwin, check-release-triggers, a stamp drift check, and scripts/check-file-length.sh.
  • Two tests in packages this change does not touch could not be judged locally: ipcendpoint (mkdir under /tmp) and projectrunner (Unix socket bind). Both failed with operation not permitted from the local sandbox; CI runs them unsandboxed.

Closes #2954

Review in cubic

When PowerShell (Get-CimInstance) outlived the 10 s process-list limit,
the kill left only "failed to retrieve Unity process list on Windows:
exit status 1", so a PowerShell or WMI that was slow to start and a
failing script looked identical (#2954).

- The error now says the listing timed out after the limit and that
  PowerShell or WMI did not respond. It says so only while the caller's
  context is alive: a caller whose own earlier deadline or cancellation
  stopped the command reports that itself.
- A script that fails on its own now carries PowerShell's stderr.
- The 10 s limit stays: with the timeout named, a slow cold start costs
  one retry, while a longer limit would lengthen every genuine WMI stall.
- The command run moves into runProcessListCommandWithin, which takes
  the timeout as a parameter like the focus helpers do, so tests reach
  the timeout without waiting. exitErrorStderr moves from the darwin-only
  focus file to the shared command_error.go so the Windows path can use
  it. The focus helpers already map their timeouts.
- Shared release input stamps are refreshed for the cli/common change.
@coderabbitai

coderabbitai Bot commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository: hatayama/unity-cli-loop/.coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: 1133c674-e580-49bf-bbf2-741296c3cbf6

📥 Commits

Reviewing files that changed from the base of the PR and between 143838a and 64c4bb1.

📒 Files selected for processing (6)
  • cli/common/unityprocess/command_error.go
  • cli/common/unityprocess/focus_darwin.go
  • cli/common/unityprocess/process.go
  • cli/common/unityprocess/process_list_command_test.go
  • cli/dispatcher/shared-inputs-stamp.json
  • cli/project-runner/shared-inputs-stamp.json
💤 Files with no reviewable changes (1)
  • cli/common/unityprocess/focus_darwin.go

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 1 remain after this review.


📝 Walkthrough

Walkthrough

Windows process listing now distinguishes its own timeout from caller cancellation. Command failures include captured stderr. Shared-input stamps were updated.

Changes

Windows process-list error handling

Layer / File(s) Summary
Shared command stderr extraction
cli/common/unityprocess/command_error.go, cli/common/unityprocess/focus_darwin.go
The stderr extraction helper moved from focus_darwin.go to command_error.go.
Windows timeout handling and validation
cli/common/unityprocess/process.go, cli/common/unityprocess/process_list_command_test.go, cli/dispatcher/shared-inputs-stamp.json, cli/project-runner/shared-inputs-stamp.json
Windows process listing now reports its own timeout separately from caller cancellation and includes stderr on command failure. Tests cover timeout, caller deadline, failure, and success. Shared-input stamps changed.

Priority: ➖ Normal

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix · Severity of issue fixed: Medium

Merge Risk: ⚪ Minimal · up to 64c4b

The change appears mergeable after normal checks. Windows PowerShell execution still needs platform validation, but no concrete failure is established.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 66.67% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 9 functions across 3 files. (2 skipped: 2… Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main change: Windows Unity process lookup timeouts now report a timeout instead of a bare exit status.
Description check ✅ Passed The description directly explains the Windows timeout behavior, stderr handling, tests, and related stamp updates.
Linked Issues check ✅ Passed Issue #2954 requires clear reporting for the Windows process-list timeout, preservation of the 10-second limit, related timeout handling, automated tests, and shared-input updates. `listUnityProcesses…
Out of Scope Changes check ✅ Passed The changes remain connected to issue #2954. The stderr helper supports clearer script-failure errors. Moving the helper from focus_darwin.go to command_error.go is a supporting refactor. The new …
Full details: Docstring Coverage

Explanation

Docstring coverage is 66.67% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 9 functions across 3 files. (2 skipped: 2 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@hatayama
hatayama merged commit 1be51a3 into main Sep 29, 2026
16 checks passed
@hatayama
hatayama deleted the fix/windows-process-list-timeout-message branch September 29, 2026 23:28
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.

Windows Unity process-list timeout is reported as a bare 'exit status 1'

1 participant