'Duration Based Apache JMeter Scenario

am running test in duration based scenario with jmeter 5.4.1, at the end of the script, test is getting stop prematurely without executing some of the calls in the last iteration, please help me to make sure all the calls executed in the last iteration, i have tried loop,duration controller nothing seems. to be prominent

Example: i have home, login, search,select item & logout, duration of 5 min with 1 user

Test execution : Home 10 login 10 search 9 select item 9 logout 9

Test execution : Home 10 login 10 search 9 select item 9 logout 9



Solution 1:[1]

If you set duration in the Thread Group or in Runtime Controller it doesn't guarantee that all Sampler will be executed equal number of times, when the duration is reached or exceeded JMeter will start shutting down the threads (virtual users) and the total number of sample results will mainly depend on the application response time.

So if you want to execute everything 10 times only - set number of loops in the Thread Group to 10 and either increase or remove the duration.

Alternatively you can use Concurrency Thread Group configured like:

enter image description here

this way 1 user will execute samplers for 5 minutes as fast as it can but not more than 10 times.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Dmitri T