Stop seed node after peer nodes in network stress test

Probably not really needed.
This commit is contained in:
Ivan Vilata-i-Balaguer 2016-05-11 20:46:40 +02:00
parent 2881a3dd63
commit 84035ae658

View File

@ -233,14 +233,14 @@ public class NetworkStressTest {
/** A barrier to wait for concurrent shutdown of services. */
final CountDownLatch shutdownLatch = new CountDownLatch((seedNode != null? 1 : 0) + peerNodes.size());
// Stop the seed node.
if (seedNode != null) {
seedNode.shutDown(shutdownLatch::countDown);
}
// Stop peer nodes.
for (P2PService peer : peerNodes) {
peer.shutDown(shutdownLatch::countDown);
}
// Stop the seed node.
if (seedNode != null) {
seedNode.shutDown(shutdownLatch::countDown);
}
// Wait for concurrent tasks to finish.
shutdownLatch.await();
print("all local nodes stopped");