Author: sebb
Date: Mon Jan  3 01:16:23 2011
New Revision: 1054512

URL: http://svn.apache.org/viewvc?rev=1054512&view=rev
Log:
Add fudge factor for overall time comparison

Modified:
    
jakarta/jmeter/trunk/test/src/org/apache/jmeter/samplers/TestSampleResult.java

Modified: 
jakarta/jmeter/trunk/test/src/org/apache/jmeter/samplers/TestSampleResult.java
URL: 
http://svn.apache.org/viewvc/jakarta/jmeter/trunk/test/src/org/apache/jmeter/samplers/TestSampleResult.java?rev=1054512&r1=1054511&r2=1054512&view=diff
==============================================================================
--- 
jakarta/jmeter/trunk/test/src/org/apache/jmeter/samplers/TestSampleResult.java 
(original)
+++ 
jakarta/jmeter/trunk/test/src/org/apache/jmeter/samplers/TestSampleResult.java 
Mon Jan  3 01:16:23 2011
@@ -215,8 +215,15 @@ public class TestSampleResult extends Te
             if (totalTime < allsamplesTime) {
                 fail("Total: "+totalTime+" < sum(samples): "+ allsamplesTime);
             }
-            if (totalTime > overallTime) {
-                fail("Total: "+totalTime+" > overall time: "+ overallTime);
+            /*
+             * The granularity of System.currentTimeMillis() - plus the fact 
that the nanoTime()
+             * offset is now calculated for each sampleResult - means that 
there can be some
+             * minor variation in the value returned by 
SampleResult#currentTimeInMillis().
+             * 
+             * Allow for this by adding a fudge factor - 3ms seems to be 
sufficient.
+            */
+            if (totalTime > overallTime+3) {
+                fail("Total: "+totalTime+" > 3 + overall time: "+ overallTime);
             }
             
             // Check that calculator gets the correct statistics from the 
sample



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to