I wanted to run the thread for 'n' number of iteration till the duration(6 hours). After 6 hours Jmeter shuts down all the threads . In my case, one of the transaction got started but before the transaction got completed the jmeter shutdown the threads as it reached the configured duration time . Is there a way for the thread to wait till the transaction gets completed ?
Looking for a solution
You can use While Controller to that and instead of setting the test duration in the Thread Group do it in the While Controller.
Put your Samplers which represent the "transaction" under the While Controller
Use the following __groovy() function as the While Controller's condition:
${__groovy((System.currentTimeMillis() - (vars.get('TESTSTART.MS') as long)) < 21600000,)}
This way: