10000 Use Trace.WriteLine when directories cannot be cleaned (in tests) · MicrosoftWebMatrix/libgit2sharp@81d1490 · GitHub
[go: up one dir, main page]

Skip to content

Commit 81d1490

Browse files
yorahnulltoken
authored andcommitted
Use Trace.WriteLine when directories cannot be cleaned (in tests)
We were previously raising an exception, which meant that there was no way to know if the test was successful or not.
1 parent 5c99eee commit 81d1490

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

LibGit2Sharp.Tests/TestHelpers/DirectoryHelper.cs

Lines changed: 3 additions &a A746 mp; 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,14 +61,14 @@ public static void DeleteDirectory(string directoryPath)
6161
{
6262
Directory.Delete(directoryPath, false);
6363
}
64-
catch (IOException ex)
64+
catch (IOException)
6565
{
66-
throw new IOException(string.Format("{0}The directory '{1}' could not be deleted!" +
66+
Trace.WriteLine(string.Format("{0}The directory '{1}' could not be deleted!" +
6767
"{0}Most of the time, this is due to an external process accessing the files in the temporary repositories created during the test runs, and keeping a handle on the directory, thus preventing the deletion of those files." +
6868
"{0}Known and common causes include:" +
6969
"{0}- Windows Search Indexer (go to the Indexing Options, in the Windows Control Panel, and exclude the bin folder of LibGit2Sharp.Tests)" +
7070
"{0}- Antivirus (exclude the bin folder of LibGit2Sharp.Tests from the paths scanned by your real-time antivirus){0}",
71-
Environment.NewLine, Path.GetFullPath(directoryPath)), ex);
71+
Environment.NewLine, Path.GetFullPath(directoryPath)));
7272
}
7373
}
7474
}

0 commit comments

Comments
 (0)
0