Skip to content

Commit

Permalink
Fix for #865
Browse files Browse the repository at this point in the history
  • Loading branch information
OsirisTerje committed Oct 6, 2021
1 parent 4025a07 commit 1b9ebbf
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/NUnitTestAdapter/NUnitEngine/NUnitEngineAdapter.cs
Original file line number Diff line number Diff line change
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 1b9ebbf

Please sign in to comment.