Bug 65008 - SampleResult.setIgnore() called from PostProcessor is not considered
Summary: SampleResult.setIgnore() called from PostProcessor is not considered
Status: RESOLVED FIXED
Alias: None
Product: JMeter - Now in Github
Classification: Unclassified
Component: Main (show other bugs)
Version: 5.4
Hardware: All All
: P2 regression (vote)
Target Milestone: JMETER 5.4.1
Assignee: JMeter issues mailing list
URL:
Keywords: FixedInTrunk
Depends on:
Blocks:
 
Reported: 2020-12-18 22:34 UTC by mspingher
Modified: 2021-01-11 20:19 UTC (History)
2 users (show)



Attachments
Sample test plan attached to verify and show the issue (19.83 KB, application/xml)
2020-12-18 22:53 UTC, mspingher
Details
Transaction controller name appears on View Results Tree and JMeter results file when using Sampler.setIgnore() in JSR23 (389.70 KB, image/jpeg)
2020-12-19 23:02 UTC, mspingher
Details

Note You need to log in before you can comment on or make changes to this bug.
Description mspingher 2020-12-18 22:34:24 UTC
Hello,

When using prev.setIgnore() in a JSR223 PostProcessor, it is not working as intended on JMeter 5.4 when attached under an HTTP Request sampler (doesn't matter if the HTTP Request sampler is inside a Transaction Controller). The HTTP Request sampler still shows up in View Results Tree and in the JMeter results file.

JMeter version - 5.4
Java version - 1.8.0_251
OS version - Windows 10 64-Bit (Build 19041)

Reproduction Steps -
1. Add a JSR223 PostProcessor to an HTTP Request sampler, select Groovy 3.0.5 as the scripting language and in the script call prev.setIgnore().
2. Switch to the View Results Tree and run the script.
3. Verify if the HTTP Request sample appears in the View Results Tree.
4. Open the JMeter results file and verify if an entry for that HTTP Request was written to the results file.

prev.setIgnore() works as intended on JMeter 4.0 r1823414.
Comment 1 Philippe Mouawad 2020-12-18 22:37:14 UTC
Hello,
Can you please attach a simple test plan showing the issue ? 

Thank you
Comment 2 mspingher 2020-12-18 22:53:21 UTC
Created attachment 37629 [details]
Sample test plan attached to verify and show the issue

Hi Philippe,

I've attached a sample test plan for you to be able to execute.

Once you run the script, you can see [MYAPI-000 - Some API] showing up in the View Results Tree as well as in the results CSV file even though the HTTP Request sampler has a JSR223 PostProcessor with prev.setIgnore().

Let me know if you need any more information!

Thank you,
- MS
Comment 3 Philippe Mouawad 2020-12-18 23:28:34 UTC
Hello,
Thanks.
Issue was introduced by misinterpretation in Bug 64581 of what seemed a useless code.

Should be fixed by:

https://github.com/apache/jmeter/commit/9841a2a64f8f908bfa97967b46636735e09b0826

Please test next nightly build and give your feedback.

Regards
Comment 4 Philippe Mouawad 2020-12-18 23:28:52 UTC
This is an automated email from the ASF dual-hosted git repository.

pmouawad pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/jmeter.git


The following commit(s) were added to refs/heads/master by this push:
     new 9841a2a  Bug 65008 - SampleResult.setIgnore() called from PostProcessor is not considered
9841a2a is described below

commit 9841a2a64f8f908bfa97967b46636735e09b0826
Author: pmouawad <p.mouawad@ubik-ingenierie.com>
AuthorDate: Sat Dec 19 00:23:46 2020 +0100

    Bug 65008 - SampleResult.setIgnore() called from PostProcessor is not
    considered
---
 .../src/main/java/org/apache/jmeter/threads/JMeterThread.java    | 9 ++++++---
 xdocs/changes.xml                                                | 1 +
 2 files changed, 7 insertions(+), 3 deletions(-)
Comment 5 mspingher 2020-12-19 03:58:11 UTC
Hi Philippe,

Thanks for looking into this so quickly and providing an update!
I'll test out the next nightly build and let you know the results.

Thank you again,
-MS (mspingher at visionpointsystems.com)
Comment 6 mspingher 2020-12-19 23:02:07 UTC
Created attachment 37633 [details]
Transaction controller name appears on View Results Tree and JMeter results file when using Sampler.setIgnore() in JSR23

Hi Philippe,

I tested the nightly build JMeter 5.4.1-SNAPSHOT 9841a2a and it worked when you have an HTTP Request sampler by itself and not inside a Transaction Controller.

This may be a different issue but when you have that HTTP Request sampler that uses SamplerResult.setIgnore() inside a Transaction Controller with or without Generate Parent Sample checked, it will still show the Transaction Controller name in the View Results Tree as well as inside the JMeter results file.

On JMeter 4.0 r1823414, this does not happen as it will ignore the Transaction Controller name and the HTTP Request sampler from showing up in the View Results Tree and JMeter results file.

I've attached a screenshot to better explain what I mean, using the same sample test script I've previously attached.

Let me know if you need any more information!

Thank you,
-MS (mspingher at visionpointsystems.com)
Comment 7 mspingher 2021-01-11 14:23:24 UTC
Hi Philippe,

Any update on my last comment from 2020-12-19 23:02:07 UTC?

Should I create a new bug ticket entry for the SamplerResult.setIgnore() not working while there is a Transaction Controller on the parent level?

Thank you,
-MS (mspingher at visionpointsystems.com)
Comment 8 Philippe Mouawad 2021-01-11 20:19:18 UTC
(In reply to mspingher from comment #7)
> Hi Philippe,
> 
> Any update on my last comment from 2020-12-19 23:02:07 UTC?
> 
> Should I create a new bug ticket entry for the SamplerResult.setIgnore() not
> working while there is a Transaction Controller on the parent level?
> 
> Thank you,
> -MS (mspingher at visionpointsystems.com)

Hello,
Yes please create a new ticket.

Thanks
Comment 9 The ASF infrastructure team 2022-09-24 20:38:21 UTC
This issue has been migrated to GitHub: https://github.com/apache/jmeter/issues/5461