Fixed shutdown order when stopping tests (clients shutdown before servers)
This commit is contained in:
parent
cf473316e6
commit
8356b20a3b
@ -197,13 +197,24 @@ class BaseTest {
|
|||||||
synchronized (lock) {
|
synchronized (lock) {
|
||||||
}
|
}
|
||||||
|
|
||||||
for (EndPoint endPointConnection : this.endPointConnections) {
|
// shutdown clients first
|
||||||
|
for (EndPoint endPoint : this.endPointConnections) {
|
||||||
endPointConnection.stop();
|
if (endPoint.getType() == Client.class) {
|
||||||
endPointConnection.waitForShutdown();
|
endPoint.stop();
|
||||||
|
endPoint.waitForShutdown();
|
||||||
|
|
||||||
latch.countDown();
|
latch.countDown();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
// shutdown servers last
|
||||||
|
for (EndPoint endPoint : this.endPointConnections) {
|
||||||
|
if (endPoint.getType() == Server.class) {
|
||||||
|
endPoint.stop();
|
||||||
|
endPoint.waitForShutdown();
|
||||||
|
|
||||||
|
latch.countDown();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// we start with "1", so make sure to end it
|
// we start with "1", so make sure to end it
|
||||||
latch.countDown();
|
latch.countDown();
|
||||||
|
Loading…
Reference in New Issue
Block a user