Skip to content

Expand use of DisposeRunners to eliminate locking assemblies - #1905

Draft
CharliePoole wants to merge 4 commits into
mainfrom
issue-1425
Draft

CharliePoole wants to merge 4 commits into
mainfrom
issue-1425

Conversation

@CharliePoole

Copy link
Copy Markdown
Member

Fixes #1425

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 High severity · 1 Medium severity

Open (5)
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.

Comment on lines 156 to +157
if (disposeRunners)
Runners.Clear();
_runners = null;
Comment on lines +30 to +32
catch (Exception ex)
{
try
{
if (_disposeRunner)
_runner.Dispose();
}
catch (Exception e)
{
_unloadException = e;
}
_unloadException = ex;

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 High severity · 4 Medium severity

Open (6)
Resolved since last review (2)

Comment on lines +52 to +55
finally
{
if (_disposeRunners)
Dispose();
Comment on lines +174 to +177
finally
{
if (_disposeRunners)
Dispose();

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 High severity · 3 Medium severity

Open (5)
Resolved since last review (2)

Comment on lines +176 to +177
if (_disposeRunners)
Dispose();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Eliminating locking of assembly file while test is loaded

2 participants