Bug 59831

Summary: Copy request, response and assertion to transaction sampler upon failure
Product: JMeter - Now in Github Reporter: Wanjun Wang <bluezero000>
Component: HTTPAssignee: JMeter issues mailing list <issues>
Status: NEEDINFO ---    
Severity: enhancement CC: p.mouawad
Priority: P2    
Version: 3.0   
Target Milestone: ---   
Hardware: All   
OS: All   

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
Comment 2 The ASF infrastructure team 2022-09-24 20:38:04 UTC
This issue has been migrated to GitHub: https://github.com/apache/jmeter/issues/4021