Bug 54467 - Loop Controller: compute loop value only once per parent iteration
Summary: Loop Controller: compute loop value only once per parent iteration
Status: RESOLVED FIXED
Alias: None
Product: JMeter - Now in Github
Classification: Unclassified
Component: Main (show other bugs)
Version: 2.8
Hardware: All All
: P3 minor (vote)
Target Milestone: ---
Assignee: JMeter issues mailing list
URL:
Keywords:
: 54317 (view as bug list)
Depends on:
Blocks:
 
Reported: 2013-01-22 12:15 UTC by Sergey
Modified: 2013-07-08 11:28 UTC (History)
3 users (show)



Attachments
Test Plan screen (87.80 KB, image/png)
2013-01-22 12:15 UTC, Sergey
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Sergey 2013-01-22 12:15:09 UTC
Created attachment 29881 [details]
Test Plan screen

if Loop controller have dynamic Loop count: ${__Random(1,12,)} for example
Order of requests can be broken
skip some request but run next

See attached image
-> Different number of samples for all Contacts wizard steps

All ok in case Loop controller have constant in Loop Count field
Comment 1 Sergey 2013-01-22 12:41:09 UTC
Reproducible for 2.8
Comment 2 Philippe Mouawad 2013-01-22 21:21:51 UTC
*** Bug 54317 has been marked as a duplicate of this bug. ***
Comment 3 Philippe Mouawad 2013-01-22 21:35:48 UTC
Issue is due to __Random being evaluated on each call to next() in Controller.
Comment 4 Philippe Mouawad 2013-01-22 21:37:05 UTC
You can do the same thing by:
- Declaring a UserDefined Variable which is equal to ${__Random(1,12,)}
- Then use it in loop
Comment 5 Philippe Mouawad 2013-01-22 22:09:27 UTC
Clarified documentation 

Date: Tue Jan 22 22:08:34 2013
New Revision: 1437215

URL: http://svn.apache.org/viewvc?rev=1437215&view=rev
Log:
https://issues.apache.org/bugzilla/show_bug.cgi?id=54467
Bugzilla Id: 54467

Modified:
    jmeter/trunk/xdocs/usermanual/component_reference.xml
Comment 6 Sergey 2013-01-24 09:01:08 UTC
:-) Documented bug is a fiche.
Of course I'm understand workaround and use it. 
But Loop controller should check conditions only before start of loop iterations, not each actions in the loop, it open way to many different bugs.

// add comment to documentation is a half of fix. (lower to minor bug)
Comment 7 Philippe Mouawad 2013-02-10 13:49:05 UTC
Date: Sun Feb 10 13:48:11 2013
New Revision: 1444543

URL: http://svn.apache.org/r1444543
Log:
Bug 54467 - Loop controller Controller check conditions each request
Bugzilla Id: 54467

Modified:
    jmeter/trunk/src/core/org/apache/jmeter/control/LoopController.java
    jmeter/trunk/xdocs/changes.xml
Comment 8 Philippe Mouawad 2013-02-10 17:10:38 UTC
Date: Sun Feb 10 17:07:19 2013
New Revision: 1444567

URL: http://svn.apache.org/r1444567
Log:
Bug 54467 - Loop controller Controller check conditions each request
Fix test failure
Bugzilla Id: 54467

Modified:
    jmeter/trunk/src/core/org/apache/jmeter/control/LoopController.java
Comment 9 Philippe Mouawad 2013-02-10 17:11:04 UTC
Date: Sun Feb 10 16:04:17 2013
New Revision: 1444558

URL: http://svn.apache.org/r1444558
Log:
Bug 54467 - Loop controller Controller check conditions each request
Error in inherited method override (test still fails with it)
Bugzilla Id: 54467

Modified:
    jmeter/trunk/src/core/org/apache/jmeter/control/LoopController.java
Comment 10 Philippe Mouawad 2013-02-10 17:14:54 UTC
Date: Sun Feb 10 17:14:11 2013
New Revision: 1444568

URL: http://svn.apache.org/r1444568
Log:
Bug 54467 - Loop controller Controller check conditions each request
Add Test
Bugzilla Id: 54467

Modified:
    jmeter/trunk/test/src/org/apache/jmeter/control/TestLoopController.java
Comment 11 Philippe Mouawad 2013-02-10 17:39:10 UTC
Date: Sun Feb 10 17:37:50 2013
New Revision: 1444571

URL: http://svn.apache.org/r1444571
Log:
Bug 54467 - Loop controller Controller check conditions each request
Use constant for -1 special value
Bugzilla Id: 54467

Modified:
    jmeter/trunk/src/core/org/apache/jmeter/control/LoopController.java
    jmeter/trunk/src/core/org/apache/jmeter/control/gui/LoopControlPanel.java
    jmeter/trunk/test/src/org/apache/jmeter/control/TestLoopController.java
Comment 12 The ASF infrastructure team 2022-09-24 20:37:52 UTC
This issue has been migrated to GitHub: https://github.com/apache/jmeter/issues/3043