mirror of https://github.com/apache/jmeter.git
Add flag forcing non-GUI JVM to exit after test
Bugzilla Id: 54669
git-svn-id: https://svn.apache.org/repos/asf/jmeter/trunk@1455289 13f79535-47bb-0310-9956-ffa450edef68
Former-commit-id: fd86c36fca
This commit is contained in:
parent
e1420aa0c5
commit
cd0bf6e2dc
|
|
@ -832,9 +832,16 @@ beanshell.server.file=../extras/startup.bsh
|
|||
#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
|
||||
|
|
|
|||
|
|
@ -86,6 +86,9 @@ public class StandardJMeterEngine implements JMeterEngine, Runnable {
|
|||
/** 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 implements JMeterEngine, Runnable {
|
|||
}
|
||||
|
||||
notifyTestListenersOfEnd(testListeners);
|
||||
|
||||
if (JMeter.isNonGUI() && SYSTEM_EXIT_FORCED) {
|
||||
log.info("Forced JVM shutdown requested at end of test");
|
||||
System.exit(0);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
|
|
|||
Loading…
Reference in New Issue