Bug 30563 - Thread Group should have a start next loop option on Sample Error
Summary: Thread Group should have a start next loop option on Sample Error
Status: CLOSED FIXED
Alias: None
Product: JMeter - Now in Github
Classification: Unclassified
Component: Main (show other bugs)
Version: 2.3.4
Hardware: Other other
: P3 enhancement with 6 votes (vote)
Target Milestone: ---
Assignee: JMeter issues mailing list
URL:
Keywords:
: 40961 (view as bug list)
Depends on:
Blocks:
 
Reported: 2004-08-10 16:00 UTC by Peter Bernier
Modified: 2011-11-12 15:37 UTC (History)
3 users (show)



Attachments
This adds the functionality to have a failed thread restart on the next iteration (5.76 KB, patch)
2007-09-17 12:01 UTC, Seth Wilcox
Details | Diff
Fixes Issue with recursive Controllers, Patch against 2.2 (6.57 KB, patch)
2007-09-17 17:08 UTC, Seth Wilcox
Details | Diff
Test case (11.79 KB, text/plain)
2008-09-23 04:24 UTC, Sebb
Details
allows threads to restart the loop when an error occurs, avoiding the samplers that appear after the error (9.42 KB, patch)
2010-07-20 15:20 UTC, Franco Sabadini
Details | Diff
plugin for this functionality (3.48 KB, text/plain)
2010-08-24 10:50 UTC, Franco Sabadini
Details
update for path from 2010-07-20 15:20 EDT (7.92 KB, patch)
2010-08-25 20:56 UTC, Franco Sabadini
Details | Diff
Test cases for validate this fix. (93.85 KB, application/octet-stream)
2011-01-11 13:24 UTC, Milamber
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Peter Bernier 2004-08-10 16:00:00 UTC
In 2.0.1 new Thread Group options were introduced that gave us more options on
what to do when a thread encounters a Sample Error.

Currently the options are to Continue, Stop Thread, or Stop Test.

I think it would be very useful to have a Next Loop option available here as well.

The reason for this is that say I'm running a load test, but only want to the
initial point where errors are encountered, and error caused by a previous
action that didn't work properly. 

The current options don't allow me to do this as 'Continue' results in a
possibly large number of cascaded errors, 'Stop Thread' will slowly kill the
load test and 'Stop Test' just isn't what I want to do.

Having a Next Loop option on the Thread Group would allow me to run a test of a
constant load of 50 users for a scheduled duration and observe where the initial
errors are encountered.
Comment 1 Michel Nolard 2007-04-24 08:40:14 UTC
I totally agree with this feature : I need it for some time now.
Comment 2 Seth Wilcox 2007-09-17 12:01:49 UTC
Created attachment 20834 [details]
This adds the functionality to have a failed thread restart on the next iteration
Comment 3 Seth Wilcox 2007-09-17 17:08:02 UTC
Created attachment 20840 [details]
Fixes Issue with recursive Controllers, Patch against 2.2

This fixes an Issue with clearing the state of recursive controllers.
Comment 4 Sebb 2008-09-23 04:24:30 UTC
Created attachment 22624 [details]
Test case

Just tried the patch (adapted for version 2.3.2) and unfortunately it does not work properly.

The attached test plan:

Thread Group 3 loops, on error next loop
 Sample BEFORE
 Sample BAD
 Sample AFTER

should result in the following output:

BEFORE
BAD
BEFORE
BAD
BEFORE
BAD

as it should always skip the AFTER sample. However, the samples are:

BEFORE
BAD
AFTER
BEFORE
BAD

When the thread group has 2 loops it generates

BEFORE
BAD
AFTER
Comment 5 tero.tasanen 2009-04-13 10:57:36 UTC
This would be a killer feature! Any change to get this included in jmeter?
Comment 6 Franco Sabadini 2010-07-20 15:20:11 UTC
Created attachment 25790 [details]
allows threads to restart the loop when an error occurs, avoiding the samplers that appear after the error

I made these changes to some of the JMeter classes to provide this functionality, because I needed it and I think it's important to have it. 

The only problem with my changes is that if the first sampler on the test tree is inside a logic controller the test will not behave properly, but in any opther cases it works great.

Let me know what you think about it and if you find some ways to improve it.

Thanks a lot.
Comment 7 Franco Sabadini 2010-08-24 10:50:35 UTC
Created attachment 25931 [details]
plugin for this functionality 

This controller skips every sampler after one that fails, for example, if the test tree is like this:

Sampler1(PASS)
Sampler2(PASS)
Sampler3(FAIL)
Sampler4(PASS)
Sampler5(PASS)

then after Sampler3 is executed and fails, Sampler4 and Sampler5 won't be executed, intead the next sampler to test will be 
Sampler1 (or the test will finish if the number of iterations is completed).

I've tested it a lot (even with other controllers inside it) and it works great. The txt file contains the code for the 2 classes that compose the plugin (SkipErrorsControllerGui.java and SkipErrorsController.java)
Comment 8 Franco Sabadini 2010-08-25 20:56:06 UTC
Created attachment 25945 [details]
update for path from 2010-07-20 15:20 EDT

It's the same patch as the one from 2010-07-20 15:20 EDT, but compared to version 2.4 of jmeter (last version)
Comment 9 Milamber 2010-08-26 04:40:24 UTC
Thanks for your new patch. It has correct format.
I tested and all seems ok (jmx test case and no regression)

I just ask me si "Restart thread" is a good label? Perhaps "Launch next iteration" or similar is a better label?

If you are ok, I can change label and some variables before put in svn. (with update docs)
Comment 10 Franco Sabadini 2010-08-26 09:54:19 UTC
(In reply to comment #9)
> Thanks for your new patch. It has correct format.
> I tested and all seems ok (jmx test case and no regression)
> 
> I just ask me si "Restart thread" is a good label? Perhaps "Launch next
> iteration" or similar is a better label?
> 
> If you are ok, I can change label and some variables before put in svn. (with
> update docs)


Sure thing Milamber,

and yes "Launch next iteration" sounds more accurate than "Restart thread" since the thread is not really restarted.

So go ahead and change the names you need, there is no problem.

Thanks a lot.
Comment 11 Milamber 2010-08-26 19:33:19 UTC
Thanks for your patch.

I changed label to "Start Next Loop" (same JMeter's vocabulary) on GUI and in source code

I added some screenshots and did a small update for docs

In a few days, you can get a JMeter Nightly Build after the revision 989973


URL: http://svn.apache.org/viewvc?rev=989973&view=rev
Log:
Bug 30563 - Thread Group should have a start next loop option on Sample Error

Modified:
    jakarta/jmeter/trunk/src/core/org/apache/jmeter/engine/StandardJMeterEngine.java
    jakarta/jmeter/trunk/src/core/org/apache/jmeter/resources/messages.properties
    jakarta/jmeter/trunk/src/core/org/apache/jmeter/resources/messages_fr.properties
    jakarta/jmeter/trunk/src/core/org/apache/jmeter/threads/AbstractThreadGroup.java
    jakarta/jmeter/trunk/src/core/org/apache/jmeter/threads/JMeterThread.java
    jakarta/jmeter/trunk/src/core/org/apache/jmeter/threads/gui/AbstractThreadGroupGui.java
    jakarta/jmeter/trunk/xdocs/changes.xml
    jakarta/jmeter/trunk/xdocs/images/screenshots/threadgroup.png
    jakarta/jmeter/trunk/xdocs/images/screenshots/webtest/threadgroup.png
    jakarta/jmeter/trunk/xdocs/images/screenshots/webtest/threadgroup2.png
    jakarta/jmeter/trunk/xdocs/usermanual/component_reference.xml
Comment 12 Franco Sabadini 2010-08-27 10:34:46 UTC
Thanks a lot Milamber.

I'm glad to have helped, please let me know if you find anything wrong with the patch.

Take care.


Franco



(In reply to comment #11)
> Thanks for your patch.
> 
> I changed label to "Start Next Loop" (same JMeter's vocabulary) on GUI and in
> source code
> 
> I added some screenshots and did a small update for docs
> 
> In a few days, you can get a JMeter Nightly Build after the revision 989973
> 
> 
> URL: http://svn.apache.org/viewvc?rev=989973&view=rev
> Log:
> Bug 30563 - Thread Group should have a start next loop option on Sample Error
> 
> Modified:
>    
> jakarta/jmeter/trunk/src/core/org/apache/jmeter/engine/StandardJMeterEngine.java
>    
> jakarta/jmeter/trunk/src/core/org/apache/jmeter/resources/messages.properties
>    
> jakarta/jmeter/trunk/src/core/org/apache/jmeter/resources/messages_fr.properties
>    
> jakarta/jmeter/trunk/src/core/org/apache/jmeter/threads/AbstractThreadGroup.java
>     jakarta/jmeter/trunk/src/core/org/apache/jmeter/threads/JMeterThread.java
>    
> jakarta/jmeter/trunk/src/core/org/apache/jmeter/threads/gui/AbstractThreadGroupGui.java
>     jakarta/jmeter/trunk/xdocs/changes.xml
>     jakarta/jmeter/trunk/xdocs/images/screenshots/threadgroup.png
>     jakarta/jmeter/trunk/xdocs/images/screenshots/webtest/threadgroup.png
>     jakarta/jmeter/trunk/xdocs/images/screenshots/webtest/threadgroup2.png
>     jakarta/jmeter/trunk/xdocs/usermanual/component_reference.xml
Comment 13 Milamber 2011-01-11 13:21:01 UTC
New commit to fix some bug

* TC as parent don't start next loop when an error apparear in subsampler
* when a sampler is follow by a TC as parent (with error), this TC don't apparear in result.


URL: http://svn.apache.org/viewvc?rev=1057782&view=rev
Log:
Since add Start Next Loop behavior ([Bug 30563] Thread Group should have a start next loop option on Sample Error), some new bugs on transaction controller with option Generate as parent enabled are come. Fix.

Modified:
    jakarta/jmeter/trunk/src/core/org/apache/jmeter/threads/JMeterThread.java
Comment 14 Milamber 2011-01-11 13:24:18 UTC
Created attachment 26477 [details]
Test cases for validate this fix.



When next nightly build will generate, please make some test, if you can.
Comment 15 Franco Sabadini 2011-05-04 14:46:47 UTC
Hi Milamber, 

I was wondering, what is the state in this? will it be in the next JMeter's release?

Thanks.


- Franco
Comment 16 Milamber 2011-05-04 21:07:37 UTC
Yes this will be in next release (no date).
You can try with JMeter nightly build
http://jakarta.apache.org/jmeter/nightly.html


(In reply to comment #15)
> Hi Milamber, 
> 
> I was wondering, what is the state in this? will it be in the next JMeter's
> release?
> 
> Thanks.
> 
> 
> - Franco
Comment 17 Milamber 2011-09-08 13:37:11 UTC
Start next loop option on error is now in JMeter 2.5
Comment 18 Philippe Mouawad 2011-11-11 15:49:52 UTC
*** Bug 45839 has been marked as a duplicate of this bug. ***
Comment 19 Philippe Mouawad 2011-11-12 15:37:52 UTC
*** Bug 40961 has been marked as a duplicate of this bug. ***
Comment 20 The ASF infrastructure team 2022-09-24 20:37:33 UTC
This issue has been migrated to GitHub: https://github.com/apache/jmeter/issues/1422