You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
EditMode tests blocked by "Save Scene" dialog when scene is dirty #525
When running EditMode tests via MCP with a dirty scene, Unity's "Save Scene" modal dialog blocks the editor event loop, causing MCP to timeout without receiving a response.
Root Cause
In TestRunnerService.RunTestsAsync(), the SaveDirtyScenesIfNeeded() method is only called for PlayMode tests:
// Current code (line 109-112)if(mode==TestMode.PlayMode){SaveDirtyScenesIfNeeded();}
This means EditMode tests don't auto-save dirty scenes, and Unity's test framework triggers a modal save dialog that blocks the entire editor.
Steps to Reproduce
Open a Unity project with MCP-for-Unity installed
Make changes to the current scene (scene becomes dirty)
Call run_tests with mode: "EditMode" via MCP
Observe: Unity shows "Save Scene" modal dialog
Result: MCP times out waiting for response
Expected Behavior
EditMode tests should auto-save dirty scenes before running, just like PlayMode tests do.
Proposed Fix
Move SaveDirtyScenesIfNeeded() outside the PlayMode conditional so it runs for all test modes:
// Before _testRunnerApi.Execute(settings):SaveDirtyScenesIfNeeded();// Save for ALL test modes, not just PlayMode
This is a one-line change in TestRunnerService.cs.
Environment
Unity MCP version: 8.7.1
Unity version: 6.3 LTS
MCP Client: Claude Code
Workaround
Manually save all scenes before running tests, or create a [InitializeOnLoad] script that registers a ICallbacks handler to auto-save on RunStarted.
Activity
Merge pr-527: fix issue CoplayDev#525 (save dirty scenes for all test…
## Pre-Launch Enhancements: Testing Infrastructure & Tool Improvements (
v9 pre-release pruning (#528)
Fix issue #525: Save dirty scenes for all test modes (#527)
Fix HTTP/Stdio Transport UX and Test Bug (#530)
Fail fast when run_tests would hit the untitled-scene save dialog