I am using Jmeter 5.2.1 with the "Classic" Thread group in order to simulate a stress scenario in which the load is continuously ramped-up to 400 threads over 2 hours. I added an AutoStop Listener which should stop the script execution when the average response Time is greater than 4000 for 20 seconds or the error rate is greater than 1% for 20 seconds.
Below is a screenshot of the Thread Group where you can also see the time shown in the top-right (well over 2 hours) which is still going at the time of writhing this (the timer is not stopping), and also the log where it's shown that the AutoStop Listener has triggered the stop condition and threads have started stopping and in the other screenshot you can see that the log writes many "Thread finished" statements, but I think the problem is that a few of the threads are hung somehow and jmeter cannot stop them.
Update: Adding another screenshot after pressing the "Stop" button from the jmeter gui. Note the time gap between the last log and the time I press the Stop button. There you can see that only after I press the button, only then I get log messages such as: Stopping: Thread Group 1-1 Interrupting: Thread Group 1-1 Stopping because end time detected by thread: Thread Group 1-1 And in the end: Notifying test listeners of end of test
Can someone please help me understand this behavior? Why isn't the execution stopping on its own?
When you launch JMeter it displays this message:
so you should not be using JMeter GUI for anything but test development and debugging, when it comes to test execution you should be running JMeter in command-line non-GUI mode like:
jmeter -n -t /path/to/your/testplan.jmx -l /path/to/results.jtl
when the test finishes you can generate HTML Reporting Dashboard to analyze the results
If you need to observe metrics in the real time you can use Backend Listener or Taurus framework