Bug 60428 - JMeter Backend Listener show exception when test ended
Summary: JMeter Backend Listener show exception when test ended
Status: RESOLVED FIXED
Alias: None
Product: JMeter
Classification: Unclassified
Component: Main (show other bugs)
Version: 3.1
Hardware: All All
: P2 regression (vote)
Target Milestone: ---
Assignee: JMeter issues mailing list
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-11-29 03:13 UTC by Liu XP
Modified: 2016-11-29 20:12 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Liu XP 2016-11-29 03:13:14 UTC
Steps:
1. Create JMeter test script with default Backend Listener.
2. Set correct graphiteHost,graphitePort,rootMetricsPrefix and samplersList.
3. Change useRegexpForSamplersList to true.
4. Run the test script.

Result:
We can see exception like below:
2016/11/29 11:01:19 WARN  - jmeter.engine.StandardJMeterEngine: Error encountered during shutdown of org.apache.jmeter.visualizers.backend.BackendListener@2b1f1961 java.lang.IllegalStateException: Failed calling teardownTest
	at org.apache.jmeter.visualizers.backend.BackendListener.testEnded(BackendListener.java:384)
	at org.apache.jmeter.visualizers.backend.BackendListener.testEnded(BackendListener.java:392)
	at org.apache.jmeter.engine.StandardJMeterEngine.notifyTestListenersOfEnd(StandardJMeterEngine.java:216)
	at org.apache.jmeter.engine.StandardJMeterEngine.run(StandardJMeterEngine.java:437)
	at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.NullPointerException
	at org.apache.jmeter.visualizers.backend.graphite.GraphiteBackendListenerClient.teardownTest(GraphiteBackendListenerClient.java:327)
	at org.apache.jmeter.visualizers.backend.BackendListener.testEnded(BackendListener.java:382)
	... 4 more


This is issue should be bring with the Bug 59099 fixed at 9 month ago.
Bug 59099 - Backend listener : Add the possibility to consider samplersList as a Regular Expression

I fixed this issue by changing code temporary. org.apache.jmeter.visualizers.backend.graphite.GraphiteBackendListenerClient
move line 304 "samplersToFilter = new HashSet<>();" after line 301
Comment 1 Liu XP 2016-11-29 03:16:47 UTC
mistake!
Move line 304 "samplersToFilter = new HashSet<>();" after line 299
Comment 2 Felix Schumacher 2016-11-29 20:12:25 UTC
Thanks for your contribution. 

I chose a slightly different approach by checking for null instead of initialising the collection, though.

Date: Tue Nov 29 20:10:27 2016
New Revision: 1771952

URL: http://svn.apache.org/viewvc?rev=1771952&view=rev
Log:
JMeter Graphite Backend Listener throws exception when test ends
and useRegexpForSamplersList is set to true.
Based on patch by Liu XP (liu_xp2003 at sina.com)

Bugzilla Id: 60428

Modified:
    jmeter/trunk/src/components/org/apache/jmeter/visualizers/backend/graphite/GraphiteBackendListenerClient.java
    jmeter/trunk/xdocs/changes.xml