chore: Remove Editor-freezing and obsolete tests from the Unity test suite

Merged
HA
4mo ago
+9-2290

Summary

  • The Unity EditMode test suite no longer freezes the Editor partway through a run.
  • Obsolete and meaningless tests that could never catch a regression are gone, so the suite is faster and easier to trust.

User Impact

  • Before: running the full EditMode suite intermittently deadlocked the Editor (the Test Runner progress bar stuck on a test name), forcing a hard kill of Unity. A managed-stack dump pinned the hang to cancellation tests that block the main thread in Task.Wait() while the awaited continuation also needs the main thread.
  • After: the full EditMode suite and the PlayMode suite both run to completion. EditMode finishes with no freeze; PlayMode passes 73/73.
  • The freeze was non-deterministic (the first run of a session could pass), which is why it had not surfaced reliably before.

Changes

All changes are test-only; no product, CLI, or Unity runtime behavior is affected.

  • Remove EditMode tests that drive the real dynamic-code compile-and-execute pipeline end-to-end (forbidden by the Unity Freeze Prevention policy): CommandRunnerTests, ExecuteDynamicCodeToolAutoUsingTests, ExecuteDynamicCodeToolSecurityTests, RestrictedModeDangerousApiTests, plus the integration fixtures in AutoInjectedNamespacesTests and PreUsingResolverTests. The pure unit tests in those files are kept.
  • Remove the cancellation-race tests in CompiledAssemblyBuilderTests (in-flight cancel + same-thread teardown wait) that the stack dump identified as the deadlock, and EditorFrameWaiterTests (fire-and-forget cross-frame work).
  • Remove a MainThreadSwitcherTests case with an unbounded WaitUntil, keeping the equivalent case that has a timeout.
  • Remove dead #if UNITYCLILOOP_HAS_ROSLYN tests (the symbol is never defined anywhere) and revive the pure parameter-validation cases; remove the obsolete TDD-scaffold DynamicCodeExecutorDictionaryErrorTest.
  • Remove placeholder/framework-only/tautological tests: the _Test_For_Test_ fixture, BasicPlayModeTests, a self-declared-obsolete RunTestsToolTests case, and the DynamicCodeSecurityManager.CanExecute tautologies.
  • Make the JsonRpcProcessorCliVersionGateTests server-busy assertions deterministic by seeding the editor play-state snapshot, fixing a pre-existing failure on a clean checkout.

Verification

  • uloop compile: 0 errors, 0 warnings.
  • uloop run-tests (EditMode): completes without freezing; the C/D/E window ran twice at 295/295.
  • uloop run-tests --test-mode PlayMode: 73/73 pass.
  • Two pre-existing failures remain (InputVisualizationCanvasPrefabTests.RuntimeSources_WhenScanned_AreEditorOnly, OnionAssemblyDependencyTests.ProductionEditorStartupHooks_WhenLoaded_AreOwnedOnlyByCompositionRootBootstrap); they also fail on a clean checkout and are outside this PR's scope.