You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2015/02/05 16:34:34 UTC
svn commit: r1657607 -
/tomcat/trunk/test/org/apache/catalina/connector/TestResponsePerformance.java
Author: markt
Date: Thu Feb 5 15:34:34 2015
New Revision: 1657607
URL: http://svn.apache.org/r1657607
Log:
Revert 1657510. Back to the "best of n" approach.
Modified:
tomcat/trunk/test/org/apache/catalina/connector/TestResponsePerformance.java
Modified: tomcat/trunk/test/org/apache/catalina/connector/TestResponsePerformance.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/catalina/connector/TestResponsePerformance.java?rev=1657607&r1=1657606&r2=1657607&view=diff
==============================================================================
--- tomcat/trunk/test/org/apache/catalina/connector/TestResponsePerformance.java (original)
+++ tomcat/trunk/test/org/apache/catalina/connector/TestResponsePerformance.java Thu Feb 5 15:34:34 2015
@@ -37,24 +37,23 @@ public class TestResponsePerformance ext
doHomebrew(resp);
doUri();
- // Performance varies significantly between local testing and CI system.
- // This test regularly causes CI failures. Therefore one homebrew win is
- // sufficient for this test to pass.
-
- final int attempts = 5;
- boolean homebrewWin = false;
+ // To allow for timing differences between runs, a "best of n" approach
+ // is taken for this test
+ final int bestOf = 5;
+ final int winTarget = (bestOf + 1) / 2;
+ int homebrewWin = 0;
int count = 0;
- while (count < attempts && !homebrewWin) {
+ while (count < bestOf && homebrewWin < winTarget) {
long homebrew = doHomebrew(resp);
long uri = doUri();
log.info("Current 'home-brew': " + homebrew + "ms, Using URI: " + uri + "ms");
if (homebrew < uri) {
- homebrewWin = true;
+ homebrewWin++;
}
count++;
}
- Assert.assertTrue(homebrewWin);
+ Assert.assertTrue(homebrewWin == winTarget);
}
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org