Fix for control flow behavior regression #606
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Programmatic manipulation of the control flow via API methods of
JMeterContext
is not working as it used to.When JMeter v5.0 introduced the "ability to Switch to next iteration of Current Loop" (see Bug 62238) the changes to
JMeterThread
were not entirely logically equivalent and broke some of our existing test when migrating to v5.x.The simplest test plan to demonstrate this is as follows, where the Debug Sampler should never be run.
(This works up to JMeter v4.0 and fails in v5.0 and above.)
Reason is the following change (refer here)
When processing the sample result, the "logical action" would only be changed if the result carried the "restart flag":
But now the result unconditionally overwrites the context's "logical action":
This PR proposes to make the action change conditional again: only if different than
CONTINUE
Motivation and Context
This fixes a breaking change from JMeter v4.0 to v5.0 that was supposed to be non-breaking.
Workarounds involve changing existing test plans by for example using
prev.setStartNextThreadLoop(true)
(or the non-deprecated equivalent)but this does not work everywhere e.g. in Preprocessors where there is no
SampleResult
yet.How Has This Been Tested?
Has not yet been tested due to the trivial nature of the change.
Screenshots (if appropriate):
Types of changes
Checklist: