We have a "loop" controler, the number of iterations of which depends on a BeanShell function. That function returns random number in some integer range. When the function returns a 0, the "loop" controller code re-evaluating the iterations field! This means if we want to run a user thread of 1000 runs with a "loop" controler that does iterations 3, 2, 4, 1, 0, 3, 2, 4, 1, 0, ... and so on each user run, the first time the iteration number hits 0, it stays 0. We made a work around with an "if" controller that checks whether we have a 0 and does not pass it to the loop controller. Cheers, Nik
Created attachment 20177 [details] Test plan to show the bug You will need to make a CSV file named "no_iterations.csv", with the number of iteration of the loop for each iteration of the threadgroup, for example like this : 2 1 0 3 You will see that you only get 3 samples (2+1).
Created attachment 20178 [details] Suggested patch This suggested patch causes the the loop evaluation to be executed on each iteration, even if the loop has had a "Loop count" of value 0 in earlier iterations. This can be useful for example if you are looping over company and their customers as an example. If some company has 0 customers, this bug means that the "customers" loop will never again be entered, even if the next company has 4 customers.
Thanks - applied to SVN in r537660
This issue has been migrated to GitHub: https://github.com/apache/jmeter/issues/1819