Repository navigation
Expand use of DisposeRunners to eliminate locking assemblies - #1905
CharliePoole wants to merge 4 commits into
Conversation
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Disposal propagation and lifecycle handling can leak agents, retain assembly locks, and swallow execution failures.
Get a fresh assessment by requesting another Copilot review.
Review effort: Lite
Findings: 4
Open (5)
Dispose child runners before discarding the runner list · New Preserve backward-compatible ProcessRunner constructor overloads · New Propagate disposeRunners to all ProcessRunner instances · New Do not classify execution failures as unload failures · New Dispose runners when asynchronous execution completes · New
What changed in this PR
Expands DisposeRunners cleanup to process runners after exploration and execution, aiming to release loaded assemblies sooner.
Changes:
- Adds disposal state to engine/process runners.
- Moves cleanup from execution tasks into runner operations.
- Refactors exploration result construction and packaging comments.
| File | Description |
|---|---|
TestExecutionTask.cs |
Removes task-level runner disposal. |
TestEngineRunner.cs |
Adds disposal configuration. |
ProcessRunner.cs |
Disposes runners after synchronous operations. |
MasterTestRunner.cs |
Clarifies exploration result stages. |
AggregatingTestRunner.cs |
Clears runners after execution. |
package-tests.cake |
Updates package-test section formatting. |
build.cake |
Updates commented package-test configuration. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| if (disposeRunners) | ||
| Runners.Clear(); | ||
| _runners = null; |
| catch (Exception ex) | ||
| { | ||
| try | ||
| { | ||
| if (_disposeRunner) | ||
| _runner.Dispose(); | ||
| } | ||
| catch (Exception e) | ||
| { | ||
| _unloadException = e; | ||
| } | ||
| _unloadException = ex; |
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Cleanup is incomplete and can leak runners, mishandle asynchronous execution, or discard results when disposal fails.
Get a fresh assessment by requesting another Copilot review.
Review effort: Lite
Findings: 2
Open (6)
Do not classify execution failures as unload failures Dispose child runners before discarding the runner list Auto-disposed runners remain reused by the aggregator · New Cleanup exceptions mask otherwise available test results · New Custom test runners are not disposed · New Dispose runners when asynchronous execution completes
Resolved since last review (2)
| finally | ||
| { | ||
| if (_disposeRunners) | ||
| Dispose(); |
| finally | ||
| { | ||
| if (_disposeRunners) | ||
| Dispose(); |
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Automatic disposal leaves cached runners reusable but permanently disposed, allowing later operations to leak newly created agents and assembly handles.
Get a fresh assessment by requesting another Copilot review.
Review effort: Lite
Findings: 2
Open (5)
Resolved since last review (2)
| if (_disposeRunners) | ||
| Dispose(); |


Fixes #1425