Expected behavior
Description
Currently in JMeterThread.java, execution loops for PreProcessors (runPreProcessors) and PostProcessors (runPostProcessors) do not wrap individual element processing in try-catch blocks.
If any PreProcessor or PostProcessor throws an unhandled RuntimeException (e.g. NullPointerException, IndexOutOfBoundsException, or malformed extraction error):
- Processor Execution Aborts: The
for loop in runPreProcessors / runPostProcessors immediately terminates, skipping all subsequent processors attached to the same sampler.
- Sampling Pipeline Bypass: Uncaught exceptions in post-processors bypass downstream steps in
executeSamplePackage including checkAssertions(), listener notifications (notifyListeners), and compiler resource cleanup (compiler.done(pack)).
By contrast, assertion processing in JMeterThread.processAssertion() explicitly wraps each assertion in try-catch (Exception | JMeterError e) to log errors and allow remaining pipeline elements to execute.
Expected Behavior
When a PreProcessor or PostProcessor throws a runtime exception:
- The error should be logged with the element's name and stack trace.
- The thread should continue executing remaining
PreProcessors or PostProcessors.
- Sample assertions, listener notifications, and compiler cleanup should execute normally.
Actual behavior
An exception in a single processor breaks out of the loop, skipping all remaining processors, assertions, and test element cleanup.
Steps to reproduce the problem
In src/core/src/main/java/org/apache/jmeter/threads/JMeterThread.java:
private static void runPostProcessors(List<? extends PostProcessor> extractors) {
for (PostProcessor ex : extractors) {
TestBeanHelper.prepare((TestElement) ex);
ex.process(); // Uncaught RuntimeException breaks loop and caller pipeline
}
}
### JMeter Version
6.0.0-SNAPSHOT
### Java Version
JDK 17 / JDK 21
### OS Version
_No response_
Expected behavior
Description
Currently in
JMeterThread.java, execution loops forPreProcessors (runPreProcessors) andPostProcessors (runPostProcessors) do not wrap individual element processing intry-catchblocks.If any
PreProcessororPostProcessorthrows an unhandledRuntimeException(e.g.NullPointerException,IndexOutOfBoundsException, or malformed extraction error):forloop inrunPreProcessors/runPostProcessorsimmediately terminates, skipping all subsequent processors attached to the same sampler.executeSamplePackageincludingcheckAssertions(), listener notifications (notifyListeners), and compiler resource cleanup (compiler.done(pack)).By contrast, assertion processing in
JMeterThread.processAssertion()explicitly wraps each assertion intry-catch (Exception | JMeterError e)to log errors and allow remaining pipeline elements to execute.Expected Behavior
When a
PreProcessororPostProcessorthrows a runtime exception:PreProcessors orPostProcessors.Actual behavior
An exception in a single processor breaks out of the loop, skipping all remaining processors, assertions, and test element cleanup.
Steps to reproduce the problem
In
src/core/src/main/java/org/apache/jmeter/threads/JMeterThread.java: