0
votes

Using jMeter to set up a soak / load test that needs to run each request with different data. The structure I currently have is

Thread Group (2 Users, 2 Loops)
- Simple controller
-- Java Sampler (Custom Plugin) to convert CSV Formula data into NewThreadData.csv (as variable)
-- Java Sampler (Custom Plugin) to create directory of files created with NewThreadData.csv merged into a template
-- While Controller Condition - js NewThreadData column not = EOF
--- CSV Data Set Config NewThreadData.csv (Recycle False / Stop of EOF False) - filename passed as variable
--- JMS PUblisher with the FileName a variable using the filename column from within NewThreadData.csv

My problem is the on the second loop, the data is updated in NewThreadData.csv, but the CSV in the while loop never runs again.

Appears that the CSV Data Set Config "knows" it has been run, regardless of the actual CSV data.

Questions

  • How can I get the CSV Data Set Config to be rerun / re executed in this scenario?
  • Are there undocumented variables or means of getting the config to reprocess?
  • Is there a way to spawn a new thread on each iteration rather than reusing the existing thread, as the CSV does execute once for each "User"[thread]. I also tried Stop on EOF : True, but that stopped the second loop.

Aim is to eventually ramp up the user count and the number of loops (changing to forever); with there being about about 100 different combinations of data to be inserted on each loop. The formula I am using has time and thread number to give me data uniqueness along with other data that is dynamically created from a formula. Recycle on EOF is not feasible as I need to regenerate the csv contents on each loop. A super-csv I don't think is feasible to cover the load and soak scenarios.

Thanks in anticipation. Andrew

2
Sadly, recycle just repeats though the existing file so doesn't meet my needs. Thanks though.Andrew

2 Answers

0
votes

I don't think it's possible to "reset" the CSV Data Set Config, it's a configuration element hence once it reads the file in its current state it will "stick" to its content.

If you're manipulating file content dynamically I would rather recommend going for __CSVRead() function instead which is evaluated in the runtime just where it's placed therefore it doesn't reserve file and it "rewinds" to the beginning of the file when the last line is read.

More information: How to Pick Different CSV Files at JMeter Runtime

0
votes

CSV Data Set Config element is executed first and only once even though you have placed it within the while controller. Hence CSV Data Set Config element is not suitable for your requirement.

You could use JSSR223 Pre-processor to work with the dynamic CSV files using a supported programming language/script (Java , Groovy)