Browse Source

Give 2 seconds to these tests to succeed instead of 1

Avoiding gump failures


git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@276056 13f79535-47bb-0310-9956-ffa450edef68
master
Antoine Levy-Lambert 21 years ago
parent
commit
29815cef7e
2 changed files with 6 additions and 5 deletions
  1. +4
    -3
      src/testcases/org/apache/tools/ant/taskdefs/ExecTaskTest.java
  2. +2
    -2
      src/testcases/org/apache/tools/ant/taskdefs/JavaTest.java

+ 4
- 3
src/testcases/org/apache/tools/ant/taskdefs/ExecTaskTest.java View File

@@ -32,10 +32,10 @@ import junit.framework.Assert;
public class ExecTaskTest extends BuildFileTest {
private static final String BUILD_PATH = "src/etc/testcases/taskdefs/exec/";
private static final String BUILD_FILE = BUILD_PATH + "exec.xml";
private final int TIME_TO_WAIT = 4;
private final int TIME_TO_WAIT = 1;
/** maximum time allowed for the build in milliseconds */
private final int MAX_BUILD_TIME = 4000;
private final int SECURITY_MARGIN = 1000; // wait 1 second extras
private final int SECURITY_MARGIN = 2000; // wait 2 second extras
// the test failed with 100 ms of margin on cvs.apache.org on August 1st, 2003
private File logFile;
private MonitoredBuild myBuild = null;
@@ -92,7 +92,8 @@ public class ExecTaskTest extends BuildFileTest {
}
// time of the build in milli seconds
long elapsed = myBuild.getTimeElapsed();
assertTrue("we waited more than the process lasted", TIME_TO_WAIT * 1000 > elapsed);
assertTrue("we waited more than the process lasted", TIME_TO_WAIT * 1000
+ SECURITY_MARGIN > elapsed);
logFile = new File(logFile.getAbsolutePath());
assertTrue("log file found after spawn", logFile.exists());
}


+ 2
- 2
src/testcases/org/apache/tools/ant/taskdefs/JavaTest.java View File

@@ -31,10 +31,10 @@ import org.apache.tools.ant.util.FileUtils;
* */
public class JavaTest extends BuildFileTest {

private static final int TIME_TO_WAIT = 4;
private static final int TIME_TO_WAIT = 1;
// wait 1 second extra to allow for java to start ...
// this time was OK on a Win NT machine and on nagoya
private static final int SECURITY_MARGIN = 1000;
private static final int SECURITY_MARGIN = 2000;

private boolean runFatalTests=false;



Loading…
Cancel
Save