Bug 57958 - Transaction Controller in "Generate Parent Sample" mode : Failed assertions do not show in 'View Results Tree' when inside check for JMeterThread.last_sample_ok
Summary: Transaction Controller in "Generate Parent Sample" mode : Failed assertions d...
Status: RESOLVED FIXED
Alias: None
Product: JMeter
Classification: Unclassified
Component: Main (show other bugs)
Version: 2.13
Hardware: All All
: P2 normal (vote)
Target Milestone: ---
Assignee: JMeter issues mailing list
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-05-27 19:08 UTC by Michael Aichlmayr
Modified: 2017-08-07 20:53 UTC (History)
1 user (show)



Attachments
JMeter script demonstrating the problem described in this report. (15.39 KB, application/xml)
2015-05-27 19:08 UTC, Michael Aichlmayr
Details
Test plan that reproduces this bug (4.85 KB, application/xml)
2017-05-10 08:01 UTC, Artem Fedorov
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Aichlmayr 2015-05-27 19:08:25 UTC
Created attachment 32760 [details]
JMeter script demonstrating the problem described in this report.

In a test plan, there is a need to fire the logout step if login was successful no matter which intermediate step fails.

In the test plan, the value of JMeterThread.last_sample_ok was used in an if-controller with 'Evaluate for all children' turned on so that any failing step inside the if-controller will skip the remaining steps.

This technique works, however, when assertions fail inside this if-controller, they are not reported in the 'View Results Tree' as errors if 'Generate Parent Sample' is enabled.

If these steps are not inside the above mentioned if-controller, they report correctly even if 'Generate Parent Sample' is enabled.

Attached is an example JMeter script that demonstrates this problem stripped down and with URLs replaced with wikipedia.org.

Running the script as posted, the 'View Results Tree' will only report logout. The failure inside the previous if-controller that caused an error (due to an assertion failure) is not reported.

If the if-controller 'Run Things' is moved outside the test for JMeterThread.last_sample_ok, the error is reported correctly.
Comment 1 Philippe Mouawad 2015-08-21 21:48:22 UTC
Issue is due to TransactionController in Parent Sample mode generation.
Comment 2 Michael Aichlmayr 2015-08-21 22:06:08 UTC
Errors should (and do in every other case) report to the View Results Tree regardless of the status of the Generate Parent Sample check-box.
Comment 3 Philippe Mouawad 2015-08-23 12:41:46 UTC
Hi,
I am not saying anything different, just pointing to root cause of your issue which is clearly due to a bug in TransactionController behaviour.
Comment 4 Artem Fedorov 2017-05-10 08:01:11 UTC
Created attachment 34989 [details]
Test plan that reproduces this bug
Comment 5 Andrey Pokhilko 2017-05-11 18:34:15 UTC
Date: Thu May 11 18:02:25 2017
New Revision: 1794861

URL: http://svn.apache.org/viewvc?rev=1794861&view=rev
Log:
Bug 57958 - Fix transaction sample not generated if thread stops/restarts

Added:
    jmeter/trunk/test/src/org/apache/jmeter/control/TestTransactionController.java
Modified:
    jmeter/trunk/src/core/org/apache/jmeter/threads/JMeterThread.java
    jmeter/trunk/xdocs/changes.xml

Modified: jmeter/trunk/src/core/org/apache/jmeter/threads/JMeterThread.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/threads/JMeterThread.java?rev=1794861&r1=1794860&r2=1794861&view=diff
Comment 6 Philippe Mouawad 2017-08-07 20:53:13 UTC
Hello,
Within Bug 61380, I changed a bit the fix here.

Can you please test again nightly build to ensure there is no regression ?
Thanks