Skip to content

Commit c681da4

Browse files
author
Niall Pemberton
committed
IO-161 Try to reduce test failures
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/io/trunk@1006091 13f79535-47bb-0310-9956-ffa450edef68
1 parent cef880c commit c681da4

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

src/test/java/org/apache/commons/io/FileCleaningTrackerTestCase.java

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ public void testFileCleanerDirectory_ForceStrategy() throws Exception {
155155
pauseForDeleteToComplete(testFile.getParentFile());
156156

157157
assertEquals(0, theInstance.getTrackCount());
158-
assertEquals(showFailures(), false, testFile.exists());
158+
assertEquals(showFailures(), false, new File(testFile.getPath()).exists());
159159
assertEquals(showFailures(), false, testFile.getParentFile().exists());
160160
}
161161

@@ -283,10 +283,14 @@ public void testFileCleanerExitWhenFinished2() throws Exception {
283283
}
284284

285285
//-----------------------------------------------------------------------
286-
private void pauseForDeleteToComplete(File file) throws Exception {
286+
private void pauseForDeleteToComplete(File file) {
287287
int count = 0;
288-
while(file.exists() && count++ < 20) {
289-
Thread.sleep(500L);
288+
while(file.exists() && count++ < 40) {
289+
try {
290+
Thread.sleep(500L);
291+
} catch (InterruptedException e) {
292+
}
293+
file = new File(file.getPath());
290294
}
291295
}
292296
private String showFailures() throws Exception {

0 commit comments

Comments
 (0)