Author: sebb
Date: Mon Mar 11 19:17:19 2013
New Revision: 1455289
URL: http://svn.apache.org/r1455289
Log:
Add flag forcing non-GUI JVM to exit after test
Bugzilla Id: 54669
Modified:
jmeter/trunk/bin/jmeter.properties
jmeter/trunk/src/core/org/apache/jmeter/engine/StandardJMeterEngine.java
jmeter/trunk/xdocs/changes.xml
Modified: jmeter/trunk/bin/jmeter.properties
URL: http://svn.apache.org/viewvc/jmeter/trunk/bin/jmeter.properties?rev=1455289&r1=1455288&r2=1455289&view=diff
==============================================================================
--- jmeter/trunk/bin/jmeter.properties (original)
+++ jmeter/trunk/bin/jmeter.properties Mon Mar 11 19:17:19 2013
@@ -832,9 +832,16 @@ beanshell.server.file=../extras/startup.
#jmeterengine.remote.system.exit=false
# Whether to call System.exit(1) on failure to stop threads in non-GUI mode.
+# This only takes effect if the test was explictly requested to stop.
# If this is disabled, it may be necessary to kill the JVM externally
#jmeterengine.stopfail.system.exit=true
+# Whether to force call System.exit(0) at end of test in non-GUI mode, even if
+# there were no failures and the test was not explicitly asked to stop.
+# Without this, the JVM may never exit if there are other threads spawned by
+# the test which never exit.
+#jmeterengine.force.system.exit=false
+
# How long to pause (in ms) in the daemon thread before reporting that the JVM has failed
to exit.
# If the value is <= 0, the JMeter does not start the daemon thread
#jmeter.exit.check.pause=2000
Modified: jmeter/trunk/src/core/org/apache/jmeter/engine/StandardJMeterEngine.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/core/org/apache/jmeter/engine/StandardJMeterEngine.java?rev=1455289&r1=1455288&r2=1455289&view=diff
==============================================================================
--- jmeter/trunk/src/core/org/apache/jmeter/engine/StandardJMeterEngine.java (original)
+++ jmeter/trunk/src/core/org/apache/jmeter/engine/StandardJMeterEngine.java Mon Mar 11 19:17:19
2013
@@ -86,6 +86,9 @@ public class StandardJMeterEngine implem
/** Whether to call System.exit(1) if threads won't stop */
private static final boolean SYSTEM_EXIT_ON_STOP_FAIL = JMeterUtils.getPropDefault("jmeterengine.stopfail.system.exit",
true);
+ /** Whether to call System.exit(0) unconditionally at end of non-GUI test */
+ private static final boolean SYSTEM_EXIT_FORCED = JMeterUtils.getPropDefault("jmeterengine.force.system.exit",
false);
+
/** Flag to show whether test is running. Set to false to stop creating more threads.
*/
private volatile boolean running = false;
@@ -435,6 +438,11 @@ public class StandardJMeterEngine implem
}
notifyTestListenersOfEnd(testListeners);
+
+ if (JMeter.isNonGUI() && SYSTEM_EXIT_FORCED) {
+ log.info("Forced JVM shutdown requested at end of test");
+ System.exit(0);
+ }
}
/**
Modified: jmeter/trunk/xdocs/changes.xml
URL: http://svn.apache.org/viewvc/jmeter/trunk/xdocs/changes.xml?rev=1455289&r1=1455288&r2=1455289&view=diff
==============================================================================
--- jmeter/trunk/xdocs/changes.xml (original)
+++ jmeter/trunk/xdocs/changes.xml Mon Mar 11 19:17:19 2013
@@ -168,6 +168,7 @@ This does not affect JMeter operation.
<h3>General</h3>
<ul>
<li><bugzilla>54584</bugzilla> - MongoDB plugin</li>
+<li><bugzilla>54669</bugzilla> - Add flag forcing non-GUI JVM to exit after
test</li>
</ul>
<h2>Non-functional changes</h2>
|