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 2021/03/12 15:23:48 UTC

[jmeter] branch master updated: Create SampleResult with 0 duration when exception is caught

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 7980249  Create SampleResult with 0 duration when exception is caught
7980249 is described below

commit 79802491d5c58d20a8218d05b88d6b659f2fbd2a
Author: Konstantin Kalinin <ko...@kkalinin.pro>
AuthorDate: Fri Mar 12 00:55:02 2021 +0300

    Create SampleResult with 0 duration when exception is caught
    
    That will use the current timestamp as start time on the Sample.
    
    Closes #650
---
 .../java/org/apache/jmeter/protocol/http/sampler/HTTPSamplerBase.java   | 2 +-
 xdocs/changes.xml                                                       | 2 ++
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/protocol/http/src/main/java/org/apache/jmeter/protocol/http/sampler/HTTPSamplerBase.java b/src/protocol/http/src/main/java/org/apache/jmeter/protocol/http/sampler/HTTPSamplerBase.java
index dee4b47..ad8cecc 100644
--- a/src/protocol/http/src/main/java/org/apache/jmeter/protocol/http/sampler/HTTPSamplerBase.java
+++ b/src/protocol/http/src/main/java/org/apache/jmeter/protocol/http/sampler/HTTPSamplerBase.java
@@ -1299,7 +1299,7 @@ public abstract class HTTPSamplerBase extends AbstractSampler
             }
             return res;
         } catch (Exception e) {
-            return errorResult(e, new HTTPSampleResult());
+            return errorResult(e, new HTTPSampleResult(0));
         }
     }
 
diff --git a/xdocs/changes.xml b/xdocs/changes.xml
index 5bc40df..8162185 100644
--- a/xdocs/changes.xml
+++ b/xdocs/changes.xml
@@ -80,6 +80,7 @@ Summary
 <ul>
   <li><bug>65027</bug>Detect mime-type for files automatically when adding files to HTTP Sampler</li>
   <li><bug>65020</bug>HTTP Sampler/Files upload tab - add missing buttons</li>
+  <li><pr>650</pr>HTTP Sampler timestamp fix when exception is caught. Contributed by Konstantin Kalinin (konstantin at kkalinin.pro)</li>
 </ul>
 
 <h3>Other samplers</h3>
@@ -181,6 +182,7 @@ Summary
   <li>Stefan Seide (stefan at trilobyte-se.de)</li>
   <li>njzukas (github.com/njzukas)</li>
   <li>David Getzlaff (david.getzlaff at t-systems.com>)</li>
+  <li>Konstantin Kalinin (konstantin at kkalinin.pro)</li>
 </ul>
 <p>We also thank bug reporters who helped us improve JMeter.</p>
 <ul>