Skip to content

Commit 1b9ebbf

Browse files
committed
Fix for #865
1 parent 4025a07 commit 1b9ebbf

1 file changed

Lines changed: 10 additions & 3 deletions

File tree

src/NUnitTestAdapter/NUnitEngine/NUnitEngineAdapter.cs

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -122,8 +122,15 @@ public void CloseRunner()
122122
if (Runner.IsTestRunning)
123123
Runner.StopRun(true);
124124

125-
Runner.Unload();
126-
Runner.Dispose();
125+
try
126+
{
127+
Runner.Unload();
128+
Runner.Dispose();
129+
}
130+
catch (NUnitEngineUnloadException ex)
131+
{
132+
logger.Warning($"Engine encountered NUnitEngineUnloadException : {ex.Message}");
133+
}
127134
Runner = null;
128135
}
129136

@@ -159,7 +166,7 @@ public string GetXmlFilePath(string folder, string defaultFileName, string exten
159166
int i = 1;
160167
while (true)
161168
{
162-
string path = Path.Combine(folder, $"{defaultFileName}.{i++}.{extension}");
169+
string path = Path.Combine(folder, $"{defaultFileName}.{i++}.{extension}");
163170
if (!File.Exists(path))
164171
return path;
165172
}

0 commit comments

Comments
 (0)