Better progress reporting in network stress test shutdown

This commit is contained in:
Ivan Vilata-i-Balaguer 2016-05-12 08:56:14 +02:00
parent 663cd82432
commit 0e9bcff2c8

View file

@ -246,11 +246,10 @@ public class NetworkStressTest {
@After @After
public void tearDown() throws InterruptedException, IOException { public void tearDown() throws InterruptedException, IOException {
print("stopping all local nodes");
/** A barrier to wait for concurrent shutdown of services. */ /** A barrier to wait for concurrent shutdown of services. */
final CountDownLatch shutdownLatch = new CountDownLatch((seedNode != null? 1 : 0) + peerNodes.size()); final CountDownLatch shutdownLatch = new CountDownLatch((seedNode != null? 1 : 0) + peerNodes.size());
print("stopping all local nodes");
// Stop peer nodes. // Stop peer nodes.
for (P2PService peer : peerNodes) { for (P2PService peer : peerNodes) {
peer.shutDown(() -> countDownAndPrint(shutdownLatch, '.')); peer.shutDown(() -> countDownAndPrint(shutdownLatch, '.'));
@ -264,6 +263,7 @@ public class NetworkStressTest {
print("all local nodes stopped"); print("all local nodes stopped");
// Cleanup test data directory. // Cleanup test data directory.
print("cleaning up test data directory");
if (testDataDir != null) { if (testDataDir != null) {
deleteTestDataDirectory(); deleteTestDataDirectory();
} }