Skip to content

Commit

Permalink
Merge pull request #895 from nunit/Issue865
Browse files Browse the repository at this point in the history
Fix for #865
  • Loading branch information
OsirisTerje committed Nov 2, 2021
2 parents 44bef83 + 20918b7 commit 42a8779
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/NUnitTestAdapter/NUnitEngine/NUnitEngineAdapter.cs
Expand Up @@ -122,8 +122,15 @@ public void CloseRunner()
if (Runner.IsTestRunning)
Runner.StopRun(true);

Runner.Unload();
Runner.Dispose();
try
{
Runner.Unload();
Runner.Dispose();
}
catch (NUnitEngineUnloadException ex)
{
logger.Warning($"Engine encountered NUnitEngineUnloadException : {ex.Message}");
}
Runner = null;
}

Expand Down Expand Up @@ -159,7 +166,7 @@ public string GetXmlFilePath(string folder, string defaultFileName, string exten
int i = 1;
while (true)
{
string path = Path.Combine(folder, $"{defaultFileName}.{i++}.{extension}");
string path = Path.Combine(folder, $"{defaultFileName}.{i++}.{extension}");
if (!File.Exists(path))
return path;
}
Expand Down

0 comments on commit 42a8779

Please sign in to comment.