Fixed shutdown order when stopping tests (clients shutdown before servers)

This commit is contained in:
nathan 2020-05-08 17:08:39 +02:00
parent cf473316e6
commit 8356b20a3b

View File

@ -197,12 +197,23 @@ class BaseTest {
synchronized (lock) {
}
for (EndPoint endPointConnection : this.endPointConnections) {
// shutdown clients first
for (EndPoint endPoint : this.endPointConnections) {
if (endPoint.getType() == Client.class) {
endPoint.stop();
endPoint.waitForShutdown();
endPointConnection.stop();
endPointConnection.waitForShutdown();
latch.countDown();
}
}
// shutdown servers last
for (EndPoint endPoint : this.endPointConnections) {
if (endPoint.getType() == Server.class) {
endPoint.stop();
endPoint.waitForShutdown();
latch.countDown();
latch.countDown();
}
}
// we start with "1", so make sure to end it