From afedfc253076398a3369aefd9922d2fe2725ae2d Mon Sep 17 00:00:00 2001 From: Robin Rosenberg Date: Fri, 10 Sep 2010 00:42:07 +0200 Subject: Comment the use of System.gc in LocalDiskRepositoryTestCase Change-Id: Ic5e9bda4275006ef3bf6ea6255ddf1c0eecc3770 Signed-off-by: Robin Rosenberg --- .../src/org/eclipse/jgit/junit/LocalDiskRepositoryTestCase.java | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'org.eclipse.jgit.junit/src') 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); } -- cgit v1.2.3