Bug 56243

Summary: Foreach works incorrectly with indexes on subsequent iterations
Product: JMeter - Now in Github Reporter: Vladimir Ryabtsev <greatvovan>
Component: MainAssignee: JMeter issues mailing list <issues>
Status: RESOLVED FIXED    
Severity: major CC: greatvovan, p.mouawad
Priority: P2    
Version: 2.9   
Target Milestone: ---   
Hardware: All   
OS: All   
Attachments: Simple test plan demonstrating the bug

Description Vladimir Ryabtsev 2014-03-11 09:02:37 UTC
Created attachment 31381 [details]
Simple test plan demonstrating the bug

ForEach Controller is used to iterate through results of extraction made by Regular Expression Extractor as recommended by documentation. Assuming RegEx found several results and I don't want to iterate through all of them, I set values for 'Start index' and 'End index' fields of ForEach Controller. On first itertion of thread ForEach works as expected, but on subsequent thread iterations ForEach does nothing.

Please see attached test plan and run it. Then look at Results Tree. You'll find that Debug sampler inside ForEach Controller reached only at first iteration of the thread, although there is no differences between the thread iterations.

Interestingly, that if we clear 'Start index' and 'End index' fields ForEach will start work as expected.
Comment 1 Philippe Mouawad 2014-03-12 21:44:35 UTC
Date: Wed Mar 12 21:42:47 2014
New Revision: 1576933

URL: http://svn.apache.org/r1576933
Log:
Bug 56243 - Foreach works incorrectly with indexes on subsequent iterations
Bugzilla Id: 56243

Added:
    jmeter/trunk/bin/testfiles/Bug56243.csv
    jmeter/trunk/bin/testfiles/Bug56243.jmx
    jmeter/trunk/bin/testfiles/Bug56243.xml   (with props)
Modified:
    jmeter/trunk/build.xml
    jmeter/trunk/src/components/org/apache/jmeter/control/ForeachController.java
    jmeter/trunk/xdocs/changes.xml


Date: Wed Mar 12 21:43:39 2014
New Revision: 1576934

URL: http://svn.apache.org/r1576934
Log:
Bug 56243 - Foreach works incorrectly with indexes on subsequent iterations
change svn eol
Bugzilla Id: 56243

Modified:
    jmeter/trunk/bin/testfiles/Bug56243.csv   (props changed)
Comment 2 Philippe Mouawad 2014-03-12 21:45:22 UTC
Thanks for report, we would be very grateful if you could test nightly build once generated to confirm issue is fixed.

https://jmeter.apache.org/nightly.html
Comment 3 Philippe Mouawad 2014-03-12 21:59:45 UTC
Date: Wed Mar 12 21:58:13 2014
New Revision: 1576941

URL: http://svn.apache.org/r1576941
Log:
Bug 56243 - Foreach works incorrectly with indexes on subsequent iterations
remove hostname from output
Bugzilla Id: 56243

Modified:
    jmeter/trunk/bin/testfiles/Bug56243.csv
    jmeter/trunk/bin/testfiles/Bug56243.jmx
    jmeter/trunk/bin/testfiles/Bug56243.xml
Comment 4 Vladimir Ryabtsev 2014-03-17 14:39:04 UTC
Verified in r1578205: bug is not reproduced.
Comment 5 The ASF infrastructure team 2022-09-24 20:37:56 UTC
This issue has been migrated to GitHub: https://github.com/apache/jmeter/issues/3340