Oh, observed with both JMeter 2.11 and 2.13. Nige
----- Original Message ----- From: "Nigel Donaldson" <[email protected]> To: [email protected] Sent: Wednesday, 13 May, 2015 3:27:16 PM Subject: Loop controller behaviour I have the following arrangement (BeanShell samplers added solely for debugging purposes): Test Plan ... - Test Fragment XYZ -- CSV Data ... -- If Controller ( condition: "${Fields_matchNr}"!="0" ) --- BeanShell Sampler #1 --- Loop Controller ( count: ${Fields_matchNr} ) ---- BeanShell Sampler #2 ---- Counter ( start: 1, max: ${Fields_matchNr} ) ---- BeanShell Sampler #3 ---- HTTP Request ---- BeanShell Sampler #4 --- BeanShell Sampler #5 ... - Thread Group - ModuleController ( -> Test Fragment XYZ ) User data is drawn from the CSV file. The run-time variable Fields_matchNr , extracted earlier, has a value of 1 for the first user, and 2 for the second user (it will have a value between 1 and 4 for other users, but is not known until run-time). I'm perplexed by my observation of differing behaviour of the loop controller in two slightly different executions of the test-plan. Concurrent execution: if I initially specify 2 threads with 1 iteration, the following expected outcome is observed: 2015/05/13 14:46:55 INFO - jmeter.engine.StandardJMeterEngine: Running the test! ... 2015/05/13 14:46:55 INFO - jmeter.gui.util.JMeterMenuBar: setRunning(true,*local*) 2015/05/13 14:46:55 INFO - jmeter.engine.StandardJMeterEngine: Starting ThreadGroup: 1 : MailNew 2015/05/13 14:46:55 INFO - jmeter.engine.StandardJMeterEngine: Starting 2 threads for group MailNew. ... 2015/05/13 14:46:56 INFO - jmeter.threads.JMeterThread: Thread started: MailNew 1-1 2015/05/13 14:46:56 INFO - jmeter.services.FileServer: Stored: ./workload/MailNewUsers.dat Alias: ./workload/MailNewUsers.dat@1116508025 ... 2015/05/13 14:47:05 INFO - jmeter.threads.JMeterThread: Thread started: MailNew 1-2 2015/05/13 14:47:07 WARN - jmeter.util.BeanShellTestElement: Debug #1 : Fields_matchNr = 1 2015/05/13 14:47:07 WARN - jmeter.util.BeanShellTestElement: Debug #2 : Fields_matchNr = 1 2015/05/13 14:47:07 WARN - jmeter.util.BeanShellTestElement: Debug #3 : Fields_matchNr = 1 2015/05/13 14:47:08 WARN - jmeter.util.BeanShellTestElement: Debug #4 : Fields_matchNr = 1 2015/05/13 14:47:09 WARN - jmeter.util.BeanShellTestElement: Debug #5 : Fields_matchNr = 1 2015/05/13 14:47:13 INFO - jmeter.threads.JMeterThread: Thread is done: MailNew 1-1 2015/05/13 14:47:13 INFO - jmeter.threads.JMeterThread: Thread finished: MailNew 1-1 2015/05/13 14:47:15 WARN - jmeter.util.BeanShellTestElement: Debug #1 : Fields_matchNr = 2 2015/05/13 14:47:15 WARN - jmeter.util.BeanShellTestElement: Debug #2 : Fields_matchNr = 2 2015/05/13 14:47:16 WARN - jmeter.util.BeanShellTestElement: Debug #3 : Fields_matchNr = 2 2015/05/13 14:47:17 WARN - jmeter.util.BeanShellTestElement: Debug #4 : Fields_matchNr = 2 2015/05/13 14:47:17 WARN - jmeter.util.BeanShellTestElement: Debug #2 : Fields_matchNr = 2 2015/05/13 14:47:17 WARN - jmeter.util.BeanShellTestElement: Debug #3 : Fields_matchNr = 2 2015/05/13 14:47:18 WARN - jmeter.util.BeanShellTestElement: Debug #4 : Fields_matchNr = 2 2015/05/13 14:47:19 WARN - jmeter.util.BeanShellTestElement: Debug #5 : Fields_matchNr = 2 2015/05/13 14:47:27 INFO - jmeter.threads.JMeterThread: Thread is done: MailNew 1-2 2015/05/13 14:47:27 INFO - jmeter.threads.JMeterThread: Thread finished: MailNew 1-2 2015/05/13 14:47:27 INFO - jmeter.engine.StandardJMeterEngine: Notifying test listeners of end of test 2015/05/13 14:47:27 INFO - jmeter.services.FileServer: Close: ./workload/MailNewUsers.dat@1116508025 2015/05/13 14:47:27 INFO - jmeter.gui.util.JMeterMenuBar: setRunning(false,*local*) Sequential execution: when I change that to 1 thread with 2 iterations (with the same two users from the CSV file): 2015/05/13 14:48:50 INFO - jmeter.engine.StandardJMeterEngine: Running the test! ... 2015/05/13 14:48:50 INFO - jmeter.gui.util.JMeterMenuBar: setRunning(true,*local*) 2015/05/13 14:48:50 INFO - jmeter.engine.StandardJMeterEngine: Starting ThreadGroup: 1 : MailNew 2015/05/13 14:48:50 INFO - jmeter.engine.StandardJMeterEngine: Starting 1 threads for group MailNew. ... 2015/05/13 14:48:50 INFO - jmeter.threads.ThreadGroup: Starting thread group number 1 threads 1 ramp-up 19 perThread 19000.0 delayedStart=true 2015/05/13 14:48:50 INFO - jmeter.threads.ThreadGroup: Started thread group number 1 2015/05/13 14:48:50 INFO - jmeter.engine.StandardJMeterEngine: All thread groups have been started 2015/05/13 14:48:50 INFO - jmeter.threads.JMeterThread: Thread started: MailNew 1-1 2015/05/13 14:48:50 INFO - jmeter.services.FileServer: Stored: ./workload/MailNewUsers.dat Alias: ./workload/MailNewUsers.dat@1800331312 2015/05/13 14:49:00 WARN - jmeter.util.BeanShellTestElement: Debug #1 : Fields_matchNr = 1 2015/05/13 14:49:01 WARN - jmeter.util.BeanShellTestElement: Debug #2 : Fields_matchNr = 1 2015/05/13 14:49:01 WARN - jmeter.util.BeanShellTestElement: Debug #3 : Fields_matchNr = 1 2015/05/13 14:49:02 WARN - jmeter.util.BeanShellTestElement: Debug #4 : Fields_matchNr = 1 2015/05/13 14:49:02 WARN - jmeter.util.BeanShellTestElement: Debug #5 : Fields_matchNr = 1 2015/05/13 14:49:15 WARN - jmeter.util.BeanShellTestElement: Debug #1 : Fields_matchNr = 2 2015/05/13 14:49:16 WARN - jmeter.util.BeanShellTestElement: Debug #5 : Fields_matchNr = 2 2015/05/13 14:49:22 ERROR - jmeter.util.BeanShellInterpreter: Error invoking bsh method: source Sourced file: ... ... 2015/05/13 14:49:24 INFO - jmeter.threads.JMeterThread: Thread is done: MailNew 1-1 2015/05/13 14:49:24 INFO - jmeter.threads.JMeterThread: Thread finished: MailNew 1-1 2015/05/13 14:49:24 INFO - jmeter.engine.StandardJMeterEngine: Notifying test listeners of end of test 2015/05/13 14:49:24 INFO - jmeter.services.FileServer: Close: ./workload/MailNewUsers.dat@1800331312 2015/05/13 14:49:24 INFO - jmeter.gui.util.JMeterMenuBar: setRunning(false,*local*) For the second user (iteration), with the field-match being correct, there is no execution in the loop controller. Huh? (As a result, an essential variable is not set, and a subsequent beanshell pre-processor fails.) What am I missing here? Help appreciated. Regards, Nige
