How to execute multiple parallel controllers simultaneously?

159 Views Asked by At

I am having 2 parallel controllers in my thread group, in both parallel controllers I have added 1 simple controller in which there are 10 API requests. When I execute the script with 2 threads and 2 sec ramp up time to check the start time of the thread groups then I observe that script completes 1 thread's parallel controller first then 2nd thread's parallel controller. Scenario - To scan the barcodes from csv file.

Expected Result: Expected_Result_table_ss

and in the meanwhile when Parallel 2 is processing the barcode, the first controller should also pick the next barcode to scan. For ex when the 2nd parallel controller is scanning 110121 at 12:00:01:190 at the same second or after some milliseconds parallel controller 1 should pick next barcode 110123 to scan.

Actual Result: ActualResult_TABLE_ss

Jmeter Script Flow : Jmeter_Script_Flow_ss

I may be wrong but I think this execution will be more precise if I am able to execute these parallel controllers simultaneously. Please let me know if any other logic can be applied for the same to scan the barcodes simultaneously using script

1

There are 1 best solutions below

0
Dmitri T On
  1. Parallel Controller executes its direct children in parallel, your "Jmeter Script Flow" means sequential execution of all "API requests" by each thread (virtual user)
  2. I don't think you understand the concept and use case for the Parallel Controller, it was implemented as a JMeter Plugin to overcome JMeter limitation of not being possible to kick off extra threads within the bounds of one virtual user making simulating AJAX calls quite hard. If scanning the barcode really produces 10 requests at exactly the same moment then your setup is good and you just need to move the "API requests" out of the "Simple Controller" so they would be direct children of the
  3. JMeter threads are absolutely independent and know nothing about each other unless you use Inter-Thread Communication Plugin so each virtual user will be executing Samplers upside down as fast as it can
  4. If you want to execute both scenarios at the same time with 2 users - take a look at Synchronizing Timer