This closes #3080
This commit is contained in:
commit
5085fabd9a
|
@ -105,11 +105,19 @@ public class ServerUtil {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void killServer(final Process server) throws Exception {
|
public static void killServer(final Process server) throws Exception {
|
||||||
|
killServer(server, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void killServer(final Process server, boolean forcibly) throws Exception {
|
||||||
if (server != null) {
|
if (server != null) {
|
||||||
System.out.println("**********************************");
|
System.out.println("**********************************");
|
||||||
System.out.println("Killing server " + server);
|
System.out.println("Killing server " + server);
|
||||||
System.out.println("**********************************");
|
System.out.println("**********************************");
|
||||||
server.destroyForcibly();
|
if (forcibly) {
|
||||||
|
server.destroyForcibly();
|
||||||
|
} else {
|
||||||
|
server.destroy();
|
||||||
|
}
|
||||||
server.waitFor();
|
server.waitFor();
|
||||||
Thread.sleep(1000);
|
Thread.sleep(1000);
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,7 +33,7 @@ public class SmokeTestBase extends ActiveMQTestBase {
|
||||||
public void after() throws Exception {
|
public void after() throws Exception {
|
||||||
for (Process process : processes) {
|
for (Process process : processes) {
|
||||||
try {
|
try {
|
||||||
ServerUtil.killServer(process);
|
ServerUtil.killServer(process, true);
|
||||||
} catch (Throwable e) {
|
} catch (Throwable e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
|
|
@ -60,7 +60,7 @@ public class MQTTLeakTest extends SmokeTestBase {
|
||||||
MQTTRunner.run();
|
MQTTRunner.run();
|
||||||
} finally {
|
} finally {
|
||||||
|
|
||||||
ServerUtil.killServer(server0);
|
ServerUtil.killServer(server0, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -122,7 +122,7 @@ public class ReplicationFlowControlTest extends SmokeTestBase {
|
||||||
if (KILL_SERVER >= 0 && i == KILL_SERVER) {
|
if (KILL_SERVER >= 0 && i == KILL_SERVER) {
|
||||||
session.commit();
|
session.commit();
|
||||||
System.out.println("Killing server");
|
System.out.println("Killing server");
|
||||||
ServerUtil.killServer(server0);
|
ServerUtil.killServer(server0, true);
|
||||||
Thread.sleep(2000);
|
Thread.sleep(2000);
|
||||||
connection.close();
|
connection.close();
|
||||||
connection = connectionFactory.createConnection();
|
connection = connectionFactory.createConnection();
|
||||||
|
|
Loading…
Reference in New Issue