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

            Bug ID: 61198
           Summary: Backend Listener does not work properly in main script
                    when included scripts also contain Backend Listener
           Product: JMeter
           Version: 3.2
          Hardware: PC
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Main
          Assignee: [email protected]
          Reporter: [email protected]
  Target Milestone: ---

Created attachment 35060
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=35060&action=edit
Example JMeter Scripts

***Use Case***
Our testing team makes heavy use of Test Fragments, Include Controllers and
Backend Listeners. 

We have a Thread Group in almost every jmx file that we use for testing while
developing the Test Fragment. This Thread Group contains a Module Controller
and several listeners, one of which is a Backend Listener. 

This Backend Listener in the included jmx file is not a part of the Test
Fragment and is scoped only to the Thread Group.

***Defect Description***
Please reference the attached jmx files:
- toBeIncluded.jmx (defines it's samplers in a Test Fragment, has a Thread
Group that references the Fragment through a Module Controller) 
- includerScript.jmx (includes toBeIncluded.jmx and defines it's own listeners)

When attempting to run our test from the main .jmx file (either in gui or from
cmd line) we see a Null Pointer Exception when the test ends, causing the main
process to never stop. 

This is reproducible by running the attached script "includerScript.jmx"

I attempted to trace this behavior through the code and came across the
constructor in the BackendListener class.
--------------------------------------------------------
/**
* Create a BackendListener.
*/
public BackendListener() {
  synchronized (LOCK) {
    queuesByTestElementName.clear();
  }

  setArguments(new Arguments());
}
--------------------------------------------------------

This constructor is called every time a file is loaded that contains a Backend
Listener. I am not familiar enough with the distributed testing feature in
JMeter to know why this might be necessary, but looking through the rest of the
code, I can't make sense of why this would need to be here.

Commenting out the .clear() command works for the above use case.

***Expected Behavior***
I expect the attached JMeter scripts to work properly. The Backend Listener in
the included .jmx file should not affect the main .jmx file's Backend Listener
just by virtue of being loaded through JMeter's Save Service.

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

Reply via email to