Bug 59831 - Copy request, response and assertion to transaction sampler upon failure
Summary: Copy request, response and assertion to transaction sampler upon failure
Status: NEEDINFO
Alias: None
Product: JMeter
Classification: Unclassified
Component: HTTP (show other bugs)
Version: 3.0
Hardware: All All
: P2 enhancement (vote)
Target Milestone: ---
Assignee: JMeter issues mailing list
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-07-08 18:51 UTC by Wanjun Wang
Modified: 2016-09-17 12:11 UTC (History)
1 user (show)



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Wanjun Wang 2016-07-08 18:51:08 UTC
To make BackendListenerClient's handle failures more easily, TransactionSampler should include the response and assertion from latest failed sub-sampler.  This can be done by adding the following code to the end of addSubSamplerResult(SampleResult res) in org.apache.jmeter.control.TransactionSampler:

        if (res.getErrorCount()>0) {
        	// Copy response and assertion for failure
        	transactionSampleResult.setRequestHeaders(res.getRequestHeaders());
        	transactionSampleResult.setResponseCode(res.getResponseCode());
        	transactionSampleResult.setResponseHeaders(res.getResponseHeaders());
        	transactionSampleResult.setResponseData(res.getResponseData());
        	for (AssertionResult a : res.getAssertionResults()) {
        		transactionSampleResult.addAssertionResult(a);
        	}
        }

Currently, TransactionSampler's SampleResult doesn't use those fields right now, so there's minimum impact.
Comment 1 Philippe Mouawad 2016-08-02 20:52:11 UTC
Hello,
Could you provide a patch after reading this:

- https://jmeter.apache.org/building.html

Thanks