Bug 56276

Summary: Loop controller becomes broken once loop count evaluates to zero
Product: JMeter Reporter: Vladimir Ryabtsev <greatvovan>
Component: MainAssignee: JMeter issues mailing list <issues>
Status: RESOLVED FIXED    
Severity: major CC: p.mouawad
Priority: P2    
Version: 2.10   
Target Milestone: ---   
Hardware: All   
OS: All   
Attachments: Demonstration of bug and workaround

Description Vladimir Ryabtsev 2014-03-17 14:20:49 UTC
Created attachment 31394 [details]
Demonstration of bug and workaround

I use a Jmeter variable for the value of Loop Count field. Loop Controller works correctly until first zero-value iteration counter. When meeting one, Loop Controller does nothin (correct) but after that it becomes broken in current thread group till the end of test: even when Loop Counter becomes non-zero Loop Controller does nothing (incorrect).

Run attached test plan and inspect Results Tree. Play with "if (iterCounter == 3)" condition and change "vars.put("num_loops",Integer.toString(0));" to any non-zero value and see that it stops breaking.

Bug appears in versions 2.10 and 2.11, and does not appear in version 2.9.


WORKAROUND:

Put Loop Controller inside If Controller to avoid passing zero values to Loop Counter (this shown in WORKAROUND thread group in attached test plan).
Comment 1 Vladimir Ryabtsev 2014-03-17 14:43:57 UTC
Bug is also reproduced in nightly build r1578205.
Comment 2 Vladimir Ryabtsev 2014-03-18 06:57:57 UTC
Got the information that workaround does not work at some cases.
Comment 3 Philippe Mouawad 2014-03-18 23:18:42 UTC
Note issue was introduced by fix to 54467
Comment 4 Philippe Mouawad 2014-03-18 23:19:03 UTC
Date: Tue Mar 18 23:17:14 2014
New Revision: 1579084

URL: http://svn.apache.org/r1579084
Log:
Bug 56276 - Loop controller becomes broken once loop count evaluates to zero
Bugzilla Id: 56276

Modified:
    jmeter/trunk/src/core/org/apache/jmeter/control/LoopController.java
    jmeter/trunk/xdocs/changes.xml
Comment 5 Vladimir Ryabtsev 2014-03-19 08:07:12 UTC
Verified in nightly build r1579114: FIXED.
Comment 6 Philippe Mouawad 2014-03-22 21:22:38 UTC
Thanks for report and tests.

Date: Sat Mar 22 21:21:44 2014
New Revision: 1580330

URL: http://svn.apache.org/r1580330
Log:
update thanks section

Modified:
    jmeter/trunk/xdocs/changes.xml