bzm - Weighted Switch Controller behaves unpredictably with nested Transaction Controllers

389 views
Skip to first unread message

tehmo...@gmail.com

unread,
Mar 12, 2020, 9:10:46 PM3/12/20
to jmeter-plugins
Hi,

We've noticed that the Weighted Switch Controller (WSC) doesn't always behave as we'd expect (though it does most of the time) when the children of it are transaction controllers that themselves have child transaction controllers.

I've attached a JMeter script that reproduces this issue.

The following is what I'd expect to happen with this script:
  • 25% chance of doing the following requests...
    • aa - Followed Nothing
      • Transaction Controller
        • a1 - Followed aa
        • a2 - Followed a1
      • a3 - Followed a2
      • Transaction Controller
        • a4 - Followed a3
        • a5 - Followed a4
  • 25% chance of doing the following requests...
    • bb - Followed Nothing
      • Transaction Controller
        • b1 - Followed bb
        • b2 - Followed b1
      • b3 - Followed b2
      • Transaction Controller
        • b4 - Followed b3
        • b5 - Followed b4
  • 25% chance of doing the following requests...
    • cc - Followed Nothing
      • Transaction Controller
        • c1 - Followed cc
        • c2 - Followed c1
      • c3 - Followed c2
      • Transaction Controller
        • c4 - Followed c3
        • c5 - Followed c4
  • 25% chance of doing the following requests...​​​​​​​
    • dd - Followed Nothing
      • Transaction Controller
        • d1 - Followed dd
        • d2 - Followed d1
      • d3 - Followed d2
      • Transaction Controller
        • d4 - Followed d3
        • d5 - Followed d4

For the most part it sticks to this workflow, but sometimes it will skip straight to (a/b/c/d)2 or (a/b/c/d)3. (See screenshot below)

I have no idea why it'll only ever skip to the 2nd or 3rd request and not the 1st, 4th, or 5th...



As it is not consistent behavior, I assume it isn't intended behavior.

I hope this qualifies as a bug, because we find this controller very useful and would very much like to use nested transaction controllers with it to quantify the time spent in business operations as well as the transactions which those operations consist of.
WeightedSwitchIssueReproduction.jmx
Message has been deleted
Message has been deleted

irinap...@gmail.com

unread,
Apr 24, 2020, 1:44:02 PM4/24/20
to jmeter-plugins
Hi
Getting similar problem with nested transaction controllers in weighted switch controllers. 
First request of second, third, etc transaction controllers is always skipped 

пятница, 13 марта 2020 г., 3:10:46 UTC+2 пользователь tehmo...@gmail.com написал:

serpu...@gmail.com

unread,
Apr 24, 2020, 2:36:28 PM4/24/20
to jmeter-plugins
I noticed that sometimes samplers are skipped if using nested transaction controllers in weighted switch controllers.
For example If you have:

- Weighted switch controller(all items = 100 weight)

- Transaction controller 1.0
 
- Transaction controller 1.1
- Sampler 1.1.1
- Sampler 1.1.2
- Transaction controller 1.2 
- Sampler 1.2.1
- Sampler 1.2.2
 
- Transaction controller 2.0
 
- Transaction controller 2.1
- Sampler 2.1.1
- Sampler 2.1.2
- Transaction controller 2.2
- Sampler 2.2.1
- Sampler 2.2.2
 
In view results tree you will see 
Sampler 1.1.1
Sampler 1.1.2
Sampler 1.2.1
Sampler 1.2.2

Sampler 2.1.1- will be not displayed
Sampler 2.1.2
Sampler 2.2.1
Sampler 2.2.2

My guess is that Weighted Switch Controller needs at least some sampler in  parent Transaction controller
As a workaround, you may add some placeholder sampler(for example jsr 223 sample with SampleResult.setIgnore(); command)
Like this
Weighted switch controller(all items = 100 weight)

- Transaction controller 1.0
 
- Transaction controller 1.1
- Sampler 1.1.1
- Sampler 1.1.2
- Transaction controller 1.2 
- Sampler 1.2.1
- Sampler 1.2.2
 
- Transaction controller 2.0
- JSR223 sample with some SampleResult.setIgnore() code
- Transaction controller 2.1
- Sampler 2.1.1
- Sampler 2.1.2
- Transaction controller 2.2
- Sampler 2.2.1
- Sampler 2.2.2
 
 As a result you should see all requests executed
 

пʼятниця, 24 квітня 2020 р. 20:44:02 UTC+3 користувач irinap...@gmail.com написав:

_BLaCK_BuLLeT_ BRoNy

unread,
Feb 15, 2022, 12:21:48 AM2/15/22
to jmeter-plugins
Faced exactly the same problem. This controller is very convenient, but this bug with skipping the first requests is extremely unpleasant. For now, I'll try to use the advice above with the JSR223 Sampler. But this is a bad solution to the problem, this bug should be fixed. I ask the developer to fix this bug in the plugin.

пятница, 24 апреля 2020 г. в 23:36:28 UTC+5, serpu...@gmail.com:
Reply all
Reply to author
Forward
0 new messages