DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUGĀ·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=41612>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED ANDĀ·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=41612

           Summary: Loop nested in IF behaves erraticly
           Product: JMeter
           Version: 2.2
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Main
        AssignedTo: [email protected]
        ReportedBy: [EMAIL PROTECTED]


Fedora Core 6 running java version
java version "1.5.0_04"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_04-b05)
Java HotSpot(TM) Client VM (build 1.5.0_04-b05, mixed mode, sharing)


I have a single thread group that is running 20 loops. Inside it has one If
Controller with the If conition (Math.random() < .3).  If I simply put a sampler
under the If, things go as expected: the sampler is run roughly 30% of the time
at random intervals. This is working perfectly.

What I want is that if the If condition is met, the sampler will be run 5 times,
then we continue through the thread group, and if there are more loops of the
thread group to run, loop through the thread group again.

I've tried this using Loop Controller, and the results were erratic. I created a
simplified test case with just the controllers and two Java samplers that echo
"Yo" and "Hello" respectively...

THREAD GROUP  L=20
|
|- IF CONTROLLER (Math.random() < .3.)
        |
        | -  "Yo"
        |
        |- LOOP CONTROLLER  = 5
                   |
                   |-- "hello"


This is what I get in terms of Yo's and Hello's  (Y and H):
Y Y H H Y Y Y H Y Y

What I should get is five hello's after each Yo. 


I also tried using a simple controller to group everything under the IF, a la

THREAD GROUP    L=20
|
|- IF CONTROLLER (Math.random() < .3.)
        |
        |-- SIMPLE
                 | -  "Yo"
                 |
                 |- LOOP CONTROLLER = 5
                            |
                            |-- "hello"


And got this in the results tree:
Y H H H H H Y H   then  no more

The first group looks good (5 Hellos for each Yo).  But that second one only has
one Hello, which isn't what I want.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to