Do you really understand what the Parallel Controller
<https://www.blazemeter.com/blog/how-to-use-the-parallel-controller-in-jmeter>does?
It appeared few years ago and it is not required for implementing
concurrency as JMeter is being used for load testing for 20+ years
without this plugin.
It *executes its children in parallel threads* and your test "design"
assumes that first you "reset" something using a JSR223 Sampler and then
you're running a while loop.
With Parallel Controller both JSR223 Sampler and the While Controller
are being executed at the same time hence the "variable" isn't getting
"reset" because the Sampler and the While Controller are running in
parallel threads and even if your Groovy code is very fast JMeter
Variables are thread local
<https://jmeter.apache.org/usermanual/functions.html> and While
Controller won't be able to access it.
Just remove the Parallel Controllers as you don't need them at all in
this case.
On 3/1/2022 4:06 AM, Nuwan Galkissa Mudalige wrote:
Hi Team,
I have two different http requests which run parallelly and will be
stopped when expectation is met. Here, I used bzm – Parallel
controller (Item Publish – Parallel, pls refer the image) to execute
those are in parallel and use While controller as child of it to
execute until the expectation is met. JSR223 sample is used to reset
the While variable for next loop.
This While setup is successfully executed for any number of iterations
without using Parallel controller. But when that setup put under the
Parallel controller, first iteration works fine for both requests but
from 2^nd iteration onwards it doesn’t get executed and throw the
below error.
Please refer the parent/child setup and error below and please share
your thoughts to resolve this case. Thank you !!
2022-03-01 08:44:56,197 INFO o.a.j.t.JMeterThread: Thread finished:
org.apache.jmeter.threads.JMeterThread@6f32f9a0 – Item Publish -
Parallel – Trans B – Item 2 Publish
2022-03-01 08:44:56,197 ERROR o.a.j.t.JMeterThread: Test failed!
java.lang.NullPointerException: Cannot invoke
"org.apache.jmeter.threads.JMeterVariables.getObject(String)" because
"threadVars" is null
at
org.apache.jmeter.control.TransactionController.notifyListeners(TransactionController.java:285)
~[ApacheJMeter_core.jar:5.4.1]
at
org.apache.jmeter.control.TransactionController.nextWithoutTransactionSampler(TransactionController.java:223)
~[ApacheJMeter_core.jar:5.4.1]
at
org.apache.jmeter.control.TransactionController.next(TransactionController.java:135)
~[ApacheJMeter_core.jar:5.4.1]
at
org.apache.jmeter.control.GenericController.nextIsAController(GenericController.java:225)
~[ApacheJMeter_core.jar:5.4.1]
at
org.apache.jmeter.control.TransactionController.nextIsAController(TransactionController.java:173)
~[ApacheJMeter_core.jar:5.4.1]
at
org.apache.jmeter.control.GenericController.next(GenericController.java:175)
~[ApacheJMeter_core.jar:5.4.1]
at
org.apache.jmeter.control.TransactionController.nextWithoutTransactionSampler(TransactionController.java:205)
~[ApacheJMeter_core.jar:5.4.1]
at
org.apache.jmeter.control.TransactionController.next(TransactionController.java:135)
~[ApacheJMeter_core.jar:5.4.1]
at
org.apache.jmeter.control.GenericController.nextIsAController(GenericController.java:222)
~[ApacheJMeter_core.jar:5.4.1]
at
org.apache.jmeter.control.GenericController.next(GenericController.java:175)
~[ApacheJMeter_core.jar:5.4.1]
at
org.apache.jmeter.control.LoopController.next(LoopController.java:134)
~[ApacheJMeter_core.jar:5.4.1]
at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:291)
[ApacheJMeter_core.jar:5.4.1]
at
com.blazemeter.jmeter.controller.JMeterThreadParallel.run(JMeterThreadParallel.java:61)
[jmeter-parallel-0.11.jar:?]
at
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
[?:?]
at java.util.concurrent.FutureTask.run(FutureTask.java:264) [?:?]
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
[?:?]
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
[?:?]
at java.lang.Thread.run(Thread.java:833) [?:?]
Regards,
Nuwan
------------------------------------------------------------------------
"Virtusa is a worldwide provider of digital business strategy, digital
engineering, and information technology (IT) services and solutions,
serving Global 2000 companies across multiple industries. We help
clients change, disrupt, and unlock new value with unmatched speed."
------------------------------------------------------------------------
This message, including any attachments, contains confidential
information intended for a specific individual and purpose, and is
intended for the addressee only. Any unauthorized disclosure, use,
dissemination, copying, or distribution of this message or any of its
attachments or the information contained in this e-mail, or the taking
of any action based on it, is strictly prohibited. If you are not the
intended recipient, please notify the sender immediately by return
e-mail and delete this message.
------------------------------------------------------------------------