You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jmeter.apache.org by fs...@apache.org on 2020/09/01 17:23:48 UTC

[jmeter] branch master updated: Allow even more delta and extract it into a constant

This is an automated email from the ASF dual-hosted git repository.

fschumacher pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/jmeter.git


The following commit(s) were added to refs/heads/master by this push:
     new 07c3983  Allow even more delta and extract it into a constant
07c3983 is described below

commit 07c3983352cdb7af6205313ef260c2bd394b9897
Author: Felix Schumacher <fe...@internetallee.de>
AuthorDate: Tue Sep 1 19:23:31 2020 +0200

    Allow even more delta and extract it into a constant
---
 .../jmeter/visualizers/backend/SamplerMetricTimedModeTest.java   | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/src/components/src/test/java/org/apache/jmeter/visualizers/backend/SamplerMetricTimedModeTest.java b/src/components/src/test/java/org/apache/jmeter/visualizers/backend/SamplerMetricTimedModeTest.java
index 833d36e..4de3a0f 100644
--- a/src/components/src/test/java/org/apache/jmeter/visualizers/backend/SamplerMetricTimedModeTest.java
+++ b/src/components/src/test/java/org/apache/jmeter/visualizers/backend/SamplerMetricTimedModeTest.java
@@ -29,6 +29,7 @@ import org.junit.jupiter.api.Test;
 public class SamplerMetricTimedModeTest {
 
     private static final int DEFAULT_ELAPSED_TIME = 1_000;
+    private static final double ALLOWED_DELTA = 25.0;
 
     @BeforeEach
     public void initMode() throws Exception {
@@ -111,8 +112,8 @@ public class SamplerMetricTimedModeTest {
         assertEquals("We are recognized as a TransactionController made sample", Boolean.TRUE,
                 Boolean.valueOf(TransactionController.isFromTransactionController(sample)));
         metric.addCumulated(sample);
-        assertEquals("Before reset  ok.max", DEFAULT_ELAPSED_TIME, metric.getOkMaxTime(), 2.001);
-        assertEquals("Before reset all.max", DEFAULT_ELAPSED_TIME, metric.getAllMaxTime(), 2.001);
+        assertEquals("Before reset  ok.max", DEFAULT_ELAPSED_TIME, metric.getOkMaxTime(), ALLOWED_DELTA);
+        assertEquals("Before reset all.max", DEFAULT_ELAPSED_TIME, metric.getAllMaxTime(), ALLOWED_DELTA);
         assertEquals("Before reset hits", 2, metric.getHits(), 0.0);
         assertEquals("Before reset sent bytes", 2000, metric.getSentBytes(), 0.0);
         assertEquals("Before reset received bytes", 4000, metric.getReceivedBytes(), 0.0);
@@ -133,8 +134,8 @@ public class SamplerMetricTimedModeTest {
         assertEquals("We are recognized as a TransactionController made sample", Boolean.TRUE,
                 Boolean.valueOf(TransactionController.isFromTransactionController(sample)));
         metric.addCumulated(sample);
-        assertEquals("Before reset  ko.max", DEFAULT_ELAPSED_TIME, metric.getKoMaxTime(), 8.001);
-        assertEquals("Before reset all.max", DEFAULT_ELAPSED_TIME, metric.getAllMaxTime(), 8.001);
+        assertEquals("Before reset  ko.max", DEFAULT_ELAPSED_TIME, metric.getKoMaxTime(), ALLOWED_DELTA);
+        assertEquals("Before reset all.max", DEFAULT_ELAPSED_TIME, metric.getAllMaxTime(), ALLOWED_DELTA);
         assertEquals("Before reset failures", 1, metric.getFailures(), 0.0);
         assertEquals("Before reset sent bytes", 2000, metric.getSentBytes(), 0.0);
         assertEquals("Before reset received bytes", 4000, metric.getReceivedBytes(), 0.0);