Author: markt
Date: Thu May  5 08:18:12 2016
New Revision: 1742372

URL: http://svn.apache.org/viewvc?rev=1742372&view=rev
Log:
Back-port test configuration option to relax timing constraints (required for 
Gump tests)

Modified:
    tomcat/tc7.0.x/trunk/BUILDING.txt
    tomcat/tc7.0.x/trunk/build.xml
    
tomcat/tc7.0.x/trunk/test/org/apache/catalina/valves/TesterAccessLogValve.java

Modified: tomcat/tc7.0.x/trunk/BUILDING.txt
URL: 
http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/BUILDING.txt?rev=1742372&r1=1742371&r2=1742372&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/BUILDING.txt (original)
+++ tomcat/tc7.0.x/trunk/BUILDING.txt Thu May  5 08:18:12 2016
@@ -415,20 +415,27 @@ For example:
 
         junit.formatter.usefile=false
 
- 5. Optional support is provided for the Cobertura code coverage tool. It
- can be enabled using the following property:
+ 5. Optional support is provided for the Cobertura code coverage tool.
 
+* NOTE: Cobertura is licensed under GPL v2 with parts of it being under
+  Apache License v1.1. See http://cobertura.sf.net for details. Using it
+  during Tomcat build is optional and is off by default.
+
+ Cobertura can be enabled using the following property:
+ 
         test.cobertura=true
 
  The report files by default are written to
 
         output/coverage
 
-* NOTE: Cobertura is licensed under GPL v2 with parts of it being under
-  Apache License v1.1. See http://cobertura.sf.net for details. Using it
-  during Tomcat build is optional and is off by default.
+ 6. Some tests include checks that the access log valve entries are as 
expected.
+    These checks include timings. On slower / loaded systems these checks will
+    often fail. The checks may be relaxed by using the following property:
+
+        test.relaxTiming=true
 
- 6. It is known that some platforms (e.g. OSX El Capitan) require IPv4 to
+ 7. It is known that some platforms (e.g. OSX El Capitan) require IPv4 to
     be the default for the multicast tests to work. This is configured by
     the following property:
 

Modified: tomcat/tc7.0.x/trunk/build.xml
URL: 
http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/build.xml?rev=1742372&r1=1742371&r2=1742372&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/build.xml (original)
+++ tomcat/tc7.0.x/trunk/build.xml Thu May  5 08:18:12 2016
@@ -69,6 +69,7 @@
   <property name="tomcat.release"        value="${tomcat.output}/release"/>
   <property name="tomcat.src.jars"       value="${tomcat.output}/src-jars"/>
   <property name="test.classes"          value="${tomcat.output}/testclasses"/>
+  <property name="test.run.classes"      value="${tomcat.output}/classes"/>
   <property name="test.temp"             value="${tomcat.output}/test-tmp"/>
   <property name="test.reports"          value="${tomcat.build}/logs"/>
   <property name="test.apr.loc"          value="${tomcat.build}/bin/native"/>
@@ -170,6 +171,7 @@
   <!-- Tests To Run -->
   <property name="test.name" value="**/Test*.java"/>
   <property name="test.formatter" 
value="-Dorg.apache.juli.formatter=java.util.logging.SimpleFormatter"/>
+  <property name="test.relaxTiming" value="false"/>
   
   <!-- Cobertura code coverage settings -->
   <property name="cobertura.out" value="${tomcat.output}/coverage"/>
@@ -1440,6 +1442,7 @@
         <sysproperty key="tomcat.test.protocol" value="@{protocol}" />
         <sysproperty key="tomcat.test.accesslog" value="${test.accesslog}" />
         <sysproperty key="tomcat.test.reports" value="${test.reports}" />
+        <sysproperty key="tomcat.test.relaxTiming" value="${test.relaxTiming}" 
/>
         <!-- File for Cobertura to write coverage results to -->
         <sysproperty key="net.sourceforge.cobertura.datafile" 
file="${cobertura.datafile}" />
 

Modified: 
tomcat/tc7.0.x/trunk/test/org/apache/catalina/valves/TesterAccessLogValve.java
URL: 
http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/test/org/apache/catalina/valves/TesterAccessLogValve.java?rev=1742372&r1=1742371&r2=1742372&view=diff
==============================================================================
--- 
tomcat/tc7.0.x/trunk/test/org/apache/catalina/valves/TesterAccessLogValve.java 
(original)
+++ 
tomcat/tc7.0.x/trunk/test/org/apache/catalina/valves/TesterAccessLogValve.java 
Thu May  5 08:18:12 2016
@@ -31,8 +31,10 @@ import org.apache.catalina.connector.Res
 
 public class TesterAccessLogValve extends ValveBase implements AccessLog {
 
-    // Timing tests need a small error margin to prevent failures
-    private static final long ERROR_MARGIN = 100;
+    private static final boolean RELAX_TIMING = 
Boolean.getBoolean("tomcat.test.relaxTiming");
+
+    // Timing tests need an error margin to prevent failures.
+    private static final long ERROR_MARGIN = RELAX_TIMING ? 2000 : 100;
 
     private final Queue<Entry> entries = new ConcurrentLinkedQueue<Entry>();
 



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to