Skip to content

Commit 233e88e

Browse files
PaulLubosclaude
andcommitted
Clear SessionState in TestJobManagerInitTimeoutTests TearDown
The persist/restore test writes synthetic jobs to SessionState, which survives domain reloads and would be re-hydrated by TestJobManager's [InitializeOnLoadMethod] hook. Flush the cleaned in-memory state back to SessionState in TearDown so test artifacts don't leak across runs. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 3df5a84 commit 233e88e

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

TestProjects/UnityMCPTests/Assets/Tests/EditMode/Services/TestJobManagerInitTimeoutTests.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,10 @@ public void TearDown()
6161
jobs?.Remove("test-init-timeout-job");
6262
jobs?.Remove("test-init-timeout-default");
6363
jobs?.Remove("test-init-timeout-persist");
64+
// Flush cleaned state to SessionState so synthetic jobs don't survive domain reloads.
65+
// The persist test writes to SessionState; without this, the stub job would be
66+
// restored on the next [InitializeOnLoadMethod] and pollute later test runs.
67+
_persistMethod.Invoke(null, new object[] { true });
6468
}
6569

6670
[Test]

0 commit comments

Comments
 (0)