Bug 59067

Summary: JMeter fails to iterate over Controllers that are children of a TransactionController having "Generate parent sample" checked after an assertion error occurs on a Thread Group with "Start Next Thread Loop"
Product: JMeter - Now in Github Reporter: benoit.wiart
Component: MainAssignee: JMeter issues mailing list <issues>
Status: RESOLVED FIXED    
Severity: major CC: kpl1888, onlinehenk, p.mouawad
Priority: P2 Keywords: PatchAvailable
Version: 2.13   
Target Milestone: ---   
Hardware: SGI   
OS: SunOS   
Attachments: BROKEN PATCH
Test Plan showing issue

Description benoit.wiart 2016-02-25 13:40:27 UTC
Test Plan is

Thread Group (1 thread, loop count=2, on error start next loop)
   Transaction controller 1 (Generate parent sample = true)
      Transaction controller 2 (Generate parent sample = true)
         Transaction controller 3 (Generate parent sample = true)
            Simple controller
               Http sampler 1
               Http sampler 2
               Http sampler 3
               Http sampler 4
               Http sampler 5
               Http sampler 6

If on first iteration there is an assertion error on sampler 3.
On second iteration the sampler controller starts on sampler 4 and bypass samplers 1,2 and 3.

That's bad and it makes me sad.
Comment 1 benoit.wiart 2016-02-25 14:03:54 UTC
Reduced test case

Thread Group (1 thread, loop count=2, on error start next loop)
   Transaction controller 1 (Generate parent sample = true)
       Simple controller
            Http sampler 1
            Http sampler 2
            Http sampler 3
            Http sampler 4
            Http sampler 5
            Http sampler 6
Comment 2 benoit.wiart 2016-02-25 15:23:07 UTC
Created attachment 33593 [details]
BROKEN PATCH

Broken patch (do not apply) as it doesn't mix well with bug 56811.
You can use it as a basis for the real correction.

The pb is that in JMeterThread#triggerEndOfLoopOnParentControllers the Sampler used is not always the "real" one, but it can be a TransactionSampler, if there is some Simplecontroller between this TransactionSampler and the http sampler, triggerEndOfLoop will not be called for those controllers.

the idea behind the patch is to always do the tree traversal from the real sampler.
Comment 3 benoit.wiart 2016-02-25 15:57:49 UTC
PR https://github.com/apache/jmeter/pull/141

Please review carefully as it may break the world...
Comment 4 Philippe Mouawad 2016-02-26 16:38:49 UTC
Author: pmouawad
Date: Fri Feb 26 16:38:10 2016
New Revision: 1732514

URL: http://svn.apache.org/viewvc?rev=1732514&view=rev
Log:
Bug 59067 - JMeter fails to iterate over Controllers that are children of a TransactionController having "Generate parent sample" checked after an assertion error occurs on a Thread Group with "Start Next Thread Loop"
Bugzilla Id: 59067

Modified:
    jmeter/trunk/src/core/org/apache/jmeter/control/TransactionController.java
    jmeter/trunk/src/core/org/apache/jmeter/threads/JMeterThread.java
    jmeter/trunk/xdocs/changes.xml
Comment 5 Philippe Mouawad 2016-02-26 16:41:27 UTC
Created attachment 33599 [details]
Test Plan showing issue
Comment 6 Philippe Mouawad 2016-02-26 21:17:33 UTC
*** Bug 58983 has been marked as a duplicate of this bug. ***
Comment 7 The ASF infrastructure team 2022-09-24 20:38:02 UTC
This issue has been migrated to GitHub: https://github.com/apache/jmeter/issues/3855