You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by Owen Pahl <ow...@gmail.com> on 2021/11/19 04:44:40 UTC

Module Controller in Included Test Fragment

Hi All,

I stumbled across this bug at work today. This was on JMeter 5.4.1 but I
expect it will impact other versions too.
Hopefully the simplified test plans below haven't been mangled by the email
handlers.

Main script

TestPlan
|--Thread-Group
|    |--Debug Sampler1
|    |--Include Controller <Second script>
|    |--Debug Sampler2
|--View Results Tree


Second script
TestPlan
|--Test Fragment
     |--Simple Controller
     |    |--Debug Sampler3
     |--Module Controller <TestPlan > Test Fragment > Simple Controller>


If you run the Main script, JMeter will throw an error saying that the
Module Controller (in the Second script) cannot find its target.
Specifically line 142 in
src/components/src/main/java/org/apache/jmeter/control/ModuleController.java
<https://github.com/apache/jmeter/blob/e7ff6eddd361b18784a827fdacb41a012d20d1c5/src/components/src/main/java/org/apache/jmeter/control/ModuleController.java#L142>


I think this is caused by the module controller looking for the path
"TestPlan > Test Fragment > Simple Controller" but that path doesn't
exist in the compiled tree (at a guess it would be "TestPlan > Thread Group
> Simple Controller" or something similar).
At this point the error seems to be very similar to 56630
<https://bz.apache.org/bugzilla/show_bug.cgi?id=56630>, or potentially even
the same bug but with added checks over time.

But then I wondered what would happen if I had a path in the Main script
that mirrored the path the Module Controller was expecting so I
updated the Main script to be:

TestPlan
|--Thread-Group
|    |--Debug Sampler1
|    |--Include Controller <Second script>
|    |--Debug Sampler2
|--View Results Tree
|--Test Fragment
     |--Simple Controller
          |--Debug Sampler4

This time the script runs but interestingly the output is:
Debug Sampler1
Debug Sampler3
Debug Sampler2

However I would have expected it to be:
Debug Sampler1
Debug Sampler4
Debug Sampler2

I'm still wrapping my head around how the Module Controller does its magic
but do the above test results indicate that there is 1 method being used to
work out of the Module Controller has a target, then a 2nd method used for
the actual replacement? Or have I missed something fundamental here?


Cheers,
Owen