apache / apache/jmeter

The Once Only controller behaves correctly under a Thread Group or Loop Controller, but otherwise its behaviour is not consistent (or clearly specified)

Open
#3,575 2 comments 0 reactions 0 assignees View on GitHub
os: All P2
Dominant language
Java
Stars
9.5k
Forks
2.3k
Avg merge
1d 22h
Merged PRs (30d)
5

Description

**Nikolay Stanoev** ([Bug 57787](https://bz.apache.org/bugzilla//show_bug.cgi?id=57787&redirect=false)):
Only once controller should be executed only once (per thread) if it is under Thread Group element. This works fine if you do not use include controller in the JMX file. But if you use include controller and some of the iterations fail then the only once controller will be executed one more time in the next iteration. You can see a simple example below.

Test Plan
-> Thread Group ( 1 thread / 10 iterations)
-> Only Once Controller
-> HTTP request
-> Module Controller ( Refer the test fragment below with include controller)
-> HTTP request ( make it fail)

-> Test Fragment
-> Include Controller ( refer a JMX file with one test fragment and a single HTTP request)

If you run a test like the one above Only Once Controller will be executed 10 times because there are 10 iterations and due to last step every iteration will fail.

Case N2:
Test Plan
-> Thread Group ( 1 thread / 10 iterations)
-> Only Once Controller
-> HTTP request
-> Module Controller
-> HTTP request ( make it fail)

-> Test Fragment
-> Copy / paste the request from Include Controller. (DO NOT USE INCLUDE CONTROLLER IN THIS STEP)

In this case Only Once controller will execute only once.

As you can see the only difference in both Test Plans is that in the first one I use Include Controller and in the second one that controller is not used.

Severity: normal
OS: All

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.