https://bz.apache.org/bugzilla/show_bug.cgi?id=64627

            Bug ID: 64627
           Summary: Programmatic manipulation of the control flow via API
                    methods of JMeterContext is not working as it used to
                    before 5.0
           Product: JMeter
           Version: 5.3
          Hardware: All
                OS: All
            Status: NEW
          Severity: major
          Priority: P2
         Component: Main
          Assignee: [email protected]
          Reporter: [email protected]
  Target Milestone: JMETER_5.3.1

As reported in https://github.com/apache/jmeter/pull/606:
----------
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.)

Test Plan
    \ Thread Group
        \ JSR223 Sampler
            ctx.setStartNextThreadLoop(true)
        \ Debug Sampler

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":

if(result.isStartNextThreadLoop()) {                
    threadContext.setStartNextThreadLoop(true); 
}

But now the result unconditionally overwrites the context's "logical action":

threadContext.setTestLogicalAction(result.getTestLogicalAction());

This PR proposes to make the action change conditional again: only if different
than CONTINUE

if (result.getTestLogicalAction() != TestLogicalAction.CONTINUE) {
    threadContext.setTestLogicalAction(result.getTestLogicalAction());
}


----------

-- 
You are receiving this mail because:
You are the assignee for the bug.

Reply via email to