Visitar URL original
run_tests(mode="PlayMode") hangs the Editor on Linux/Vulkan — no test starts, futex_do_wait · Issue #1390 · CoplayDev/unity-mcp · GitHub
Skip to content

run_tests(mode="PlayMode") hangs the Editor on Linux/Vulkan — no test starts, futex_do_wait #1390

Open

Description

@qoyri

Summary

run_tests(mode="PlayMode") never starts any test and hangs the Unity Editor. EditMode
runs are fine, and entering Play Mode manually is fine. Only the PlayMode test run is
affected.

Environment

MCPForUnity v10.1.2 (com.coplaydev.unity-mcp, git #v10.1.2)
Server mcpforunityserver==10.1.2, HTTP transport, 127.0.0.1:8790, --project-scoped-tools
Unity 2022.3.22f1 (887be4894c44)
OS Arch Linux, kernel 7.2.3
Graphics Vulkan (-force-vulkan), NVIDIA RTX 3060, driver 610.57.04
Project VRChat avatar project: SDK 3.5.0, NDMF 1.14.3, Modular Avatar 1.17.1, VRCFury 1.1341.0

Symptom

run_tests(mode="PlayMode", test_names=[...], init_timeout=180000)
  -> status: running
  -> ... 180 s ...
  -> status: failed
     error: "Test job failed to initialize (tests did not start within timeout)"
     progress.completed: 0

Meanwhile the Editor:

  • Editor.log stops growing — 0 bytes added across samples 5 s, 8 s and 10 s apart;
  • ~140 % CPU, 173 threads;
  • /proc/<pid>/wchan = futex_do_wait;
  • stops answering the bridge: Unity session not ready ... (ping not answered);
  • does not respond to SIGTERM — left for 5 minutes with no progress; SIGKILL required.

Last log lines before the freeze:

MCP-FOR-UNITY: [TestRunnerNoThrottle] Applied No Throttling for test run.
MCPForUnity.Editor.Services.TestJobManager:StartJob (UnityEditor.TestTools.TestRunner.Api.TestMode, ...)
MCP-FOR-UNITY: [TestJobManager] Job <id> failed to initialize within 180000ms, auto-failing

Often preceded by (Linux-specific):

(unityhub-unity-editor-2022.3.22f1:<pid>): GLib-GIO-CRITICAL **:
  g_dbus_proxy_call_sync_internal: assertion 'G_IS_DBUS_PROXY (proxy)' failed

Reproduction

Three out of three attempts, two of which rule out the usual explanations:

# Conditions Result
1 Working scene loaded, Editor had gone through ~10 forced domain reloads hang
2 Freshly restarted Editor, same scene hang
3 Freshly restarted Editor, empty scene created for the test hang

Case 3 rules out the scene; case 2 rules out a Test Runner left stuck by a previous run.

What does work

  • run_tests(mode="EditMode"): 322 tests in 3.1 s, no incident, including right after a
    hang and restart.
  • Entering Play Mode manually: manage_editor(action="play") returns "Entered play mode"
    and the Editor stays healthy. So Play Mode itself is not the problem — driving it from the
    Test Runner API is.
  • run_tests(clear_stuck: true) returns No running job to clear, so stale job state is not
    the cause.

Lead (not verified — I did not instrument the bridge)

The hang happens between TestJobManager.StartJob and the first Test Runner callback.
futex_do_wait with a frozen log suggests waiting on a lock that is never released —
plausibly a synchronisation between the HTTP bridge thread and the Editor main thread at the
moment TestRunnerApi triggers the Play Mode transition. The Linux-specific D-Bus
GLib-GIO-CRITICAL may be a hint about the environment in which that transition goes wrong.

Impact

Not blocking for everyday use — EditMode covers most of it. It does block anything that needs
a measurement in Play Mode: in our case, Frame Debugger based draw-call attribution, and any
end-to-end test of frame capture. One test in our suite is marked [Ignore] because of this.

Workaround

None known for PlayMode test runs. For a one-off measurement, manage_editor(action="play")
plus manual reading works — but that is not a test.

Activity

  1. qoyri commented on Sep 13, 2026

    @qoyri
    Author

    Correction to my own report, and an additional observation.

    Two statements in the original issue are stated more firmly than my evidence supports, and I
    want to correct them rather than leave a maintainer chasing them:

    1. I wrote that manual Play Mode works, "so Play Mode itself is not the problem", which implies
      the Test Runner API path is. What I actually established is only that manual entry does not
      hang. I did not instrument either path, so I cannot say where they diverge.
    2. I described the bridge as alive and concluded the Editor main thread was the one not
      draining. A plugin that re-registers without passing commands is consistent with a blocked
      Editor and with a bridge that stops emitting. I have not measured which.

    The reproduction itself (3/3, including a fresh Editor and an empty scene) and the symptom table
    stand as measured.

    Additional, possibly related: since filing, I have seen four occurrences of a different
    failure on this setup — run_tests (EditMode) returning "Test job failed to initialize (tests
    did not start within timeout)" while the Editor stays responsive: read_console and
    execute_code both answer normally, and clear_stuck reports "No running job to clear". In one
    case the job auto-failed while a test run was recorded on the Editor side by my own
    ICallbacks hook on TestRunnerApi — so the job manager and the Test Runner disagreed about
    whether a run had started. Retrying a third time with init_timeout: 300000 succeeded in 39 s,
    but the first two attempts (120 s, 180 s) did not, so I do not claim the timeout value is the
    factor — only that I changed it.

    Environment unchanged: MCPForUnity v10.1.2, Unity 2022.3.22f1, Arch Linux, Vulkan.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions