I have JMeter script which tests REST API.
It is configured with Junit Request:
During the test, I am posting a lot of items. I want to clean up DB after test execution. I put appropriate logic to tearDown()
.
However, I found that execution from console doesn't call teaDown()
!
Launching from UI works fine.
Here is implementation for tearDown()
:
@AfterClass
public static void tearDown() throws Exception {
LOG.info("tearDown() called");
deleteRecordingsFromDb();
SCHEDULED_EXECUTOR_SERVICE.shutdown();
if (client != null && !client.isClosed()) {
client.close();
}
minClient = null;
}
Also, be aware that Throughput Shaping Timer is used. And parameter is passed with -Jload-profiles="..."
How to make tearDown() executable from the console?