From 90a2a192dc50a66e8187a16f3dd99cfb8acceb25 Mon Sep 17 00:00:00 2001 From: Stefan Bodewig Date: Wed, 3 Mar 2004 14:35:24 +0000 Subject: [PATCH] This test has been randomly failing on Unix systems ever since their file system is considered to have a granularity of a second. Give it the same treatment as Windows. git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@276189 13f79535-47bb-0310-9956-ffa450edef68 --- src/testcases/org/apache/tools/ant/taskdefs/JarTest.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/testcases/org/apache/tools/ant/taskdefs/JarTest.java b/src/testcases/org/apache/tools/ant/taskdefs/JarTest.java index 45455ae88..968433d11 100644 --- a/src/testcases/org/apache/tools/ant/taskdefs/JarTest.java +++ b/src/testcases/org/apache/tools/ant/taskdefs/JarTest.java @@ -30,6 +30,7 @@ import java.util.zip.ZipEntry; import java.util.zip.ZipFile; import org.apache.tools.ant.BuildFileTest; import org.apache.tools.ant.taskdefs.condition.Os; +import org.apache.tools.ant.util.FileUtils; /** * @author Erik Meade @@ -124,10 +125,8 @@ public class JarTest extends BuildFileTest { private void testRecreate(String firstTarget, String secondTarget) { executeTarget(firstTarget); - int sleeptime = 2500; - if (Os.isFamily("windows")) { - sleeptime += 2500; - } + long sleeptime = 3000 + + FileUtils.newFileUtils().getFileTimestampGranularity(); try { Thread.currentThread().sleep(sleeptime); } catch (InterruptedException e) {