git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[JGIT RFC PATCH 3/3] Rate limit warnings spewed by RepositoryTestCase.recursiveDelete

From
Jonas Fonseca <fonseca@diku.dk>
Date
Oct 22, 2008, 08:34 UTC
Message-ID
<20081022083420.GC17940@diku.dk>

On Windows XP / NTFS / NetBeans 6.1 / Java 5 a lot of warnings are printed. In most cases the path is in fact deleted and it seems to just be a timing bug or something Windows or NTFS specific. Also, many of the warnings are for the same paths and therefore a bit redundant. Furthermore, when a lot of warnings are printed it gives the feeling of slowing down the tests. By rate limiting the warnings the problem is still made visible for developers to notice.

Signed-off-by: Jonas Fonseca <fonseca@diku.dk>
---
 .../org/spearce/jgit/lib/RepositoryTestCase.java   |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
 This is mostly an annoyance fix, but might be acceptable.
diff --git a/org.spearce.jgit.test/tst/org/spearce/jgit/lib/RepositoryTestCase.java b/org.spearce.jgit.test/tst/org/spearce/jgit/lib/RepositoryTestCase.java
index 9d7d133..44e24d7 100644
--- a/org.spearce.jgit.test/tst/org/spearce/jgit/lib/RepositoryTestCase.java
+++ b/org.spearce.jgit.test/tst/org/spearce/jgit/lib/RepositoryTestCase.java
@@ -51,6 +51,8 @@
 
 public abstract class RepositoryTestCase extends TestCase {
 
+	private static long deleteFailures;
+
 	protected final File trashParent = new File("trash");
 
 	protected File trash;
@@ -79,7 +81,7 @@ protected static void recursiveDelete(final File dir) {
 			}
 		}
 		dir.delete();
-		if (dir.exists()) {
+		if (dir.exists() && deleteFailures++ < 42) {
 			System.out.println("Warning: Failed to delete " + dir);
 		}
 	}
-- 
1.6.0.2.1166.g8d97a.dirty

-- 
Jonas Fonseca
Next: Robin Rosenberg
Message 1 of 4 in “Rate limit warnings spewed by RepositoryTestCase.recursiveDelete”
  1. 3/3 Rate limit warnings spewed by RepositoryTestCase.recursiveDeleteJonas Fonseca, Oct 22, 2008
  2. Robin RosenbergOct 23, 2008
  3. Jonas FonsecaOct 30, 2008
  4. Robin RosenbergOct 31, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.