summaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.junit
diff options
context:
space:
mode:
Diffstat (limited to 'org.eclipse.jgit.junit')
-rw-r--r--org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/LocalDiskRepositoryTestCase.java5
1 files changed, 5 insertions, 0 deletions
diff --git a/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/LocalDiskRepositoryTestCase.java b/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/LocalDiskRepositoryTestCase.java
index 568fcdcd0e..dd143826ec 100644
--- a/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/LocalDiskRepositoryTestCase.java
+++ b/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/LocalDiskRepositoryTestCase.java
@@ -119,6 +119,11 @@ public abstract class LocalDiskRepositoryTestCase extends TestCase {
shutdownHook = new Thread() {
@Override
public void run() {
+ // On windows accidentally open files or memory
+ // mapped regions may prevent files from being deleted.
+ // Suggesting a GC increases the likelihood that our
+ // test repositories actually get removed after the
+ // tests, even in the case of failure.
System.gc();
recursiveDelete("SHUTDOWN", trash, false, false);
}