Skip to content

[MEDIUM] MCPTestWindow stores verification state in static mutable fields #89

Description

@Daliys

Problem

MCPTestWindow uses static mutable fields for UI verification state, and CreateGUI resets them whenever the visual tree is rebuilt.

Evidence

  • Editor/MCPTestWindow.cs:21 declares static LastInputValue.
  • Editor/MCPTestWindow.cs:26 declares static ButtonClicked.
  • Editor/MCPTestWindow.cs:64-70 resets both fields during CreateGUI.
  • Editor/UIVerification.cs:41-48 asserts against those static fields after RPC-driven input/click calls.

Impact

Multiple test-window instances, window rebuilds, domain reload effects, or concurrent UI automation can clobber verification state and produce flaky false failures.

Suggested fix

Store verification state on the window instance or in a scoped verification object instead of static fields. Reset state explicitly at the start of verification rather than every CreateGUI rebuild.

Source report

Imported from audit report item: concurrency (4) / Editor/MCPTestWindow.cs:21.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingneeds-triageImported or reported issue awaiting owner reviewpriority: mediumImportant defect or workflow gap with workaroundsurface: testsTest runner, test windows, or verification helperssurface: uiEditor UI Toolkit automation and window workflowstype: concurrencyConcurrency, timeout, async, or shared-state issue

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions