I have a excel file and it's each row contains parameters required to form HTTP request for JMeter. JMeter test plan has 2 Thread groups.These thread groups run concurrently. Each Thread group considered to read parameters from row of excel file and send HTTP request then write response back to excel file, but out of these multiple thread groups only single thread group able to write, other are unable to do this.can anybody provide suggestion why this happening. (There is no any exception related to concurrent file access in JMeter log.)
1 Answers
Writing into the same file from multiple threads is not the best idea as you may run into the race condition. So kindly avoid doing this using multiple threads unless the writing logic is under Critical Section Controller however it might have negative impact on your test throughput as only 1 thread will be able to write into the file at a time.
A better solution would be passing values from one group to another using in-memory approach, to wit without any interim files. You can use __setProperty() function to define the property in 1st Thread Group and __P() function to read the value in 2nd Thread Group.
If you're running Thread Groups at the same time you can pass the values between the groups using Inter-Thread Communication Plugin, check out SynchronizationExample.jmx Test Plan for example implementation.
You can install Inter-Thread Communication Plugin using JMeter Plugins Manager.