Minor changes to comments and printed messages

This commit is contained in:
Ivan Vilata-i-Balaguer 2016-05-03 11:08:10 +02:00
parent 53901ba798
commit 109a71cd7f

View file

@ -186,7 +186,7 @@ public class NetworkStressTest {
final CountDownLatch receivedDirectLatch = new CountDownLatch(nPeers); final CountDownLatch receivedDirectLatch = new CountDownLatch(nPeers);
final Instant sendStart = Instant.now(); final Instant sendStart = Instant.now();
for (final P2PService srcPeer : peerNodes) { for (final P2PService srcPeer : peerNodes) {
// Make peer ready for receiving direct messages. // Make the peer ready for receiving direct messages.
srcPeer.addDecryptedDirectMessageListener((decryptedMsgWithPubKey, peerNodeAddress) -> { srcPeer.addDecryptedDirectMessageListener((decryptedMsgWithPubKey, peerNodeAddress) -> {
if (!(decryptedMsgWithPubKey.message instanceof StressTestDirectMessage)) if (!(decryptedMsgWithPubKey.message instanceof StressTestDirectMessage))
return; return;
@ -218,12 +218,12 @@ public class NetworkStressTest {
// Wait for peers to complete receiving. // Wait for peers to complete receiving.
org.junit.Assert.assertTrue("timed out while receiving direct messages", org.junit.Assert.assertTrue("timed out while receiving direct messages",
receivedDirectLatch.await(30, TimeUnit.SECONDS)); receivedDirectLatch.await(30, TimeUnit.SECONDS));
print("receiving 1 direct message per node took %ss", print("receiving 1 direct message per peer took %ss",
Duration.between(sendStart, Instant.now()).toMillis()/1000.0); Duration.between(sendStart, Instant.now()).toMillis()/1000.0);
// Wait for peers to complete sending. // Wait for peers to complete sending.
org.junit.Assert.assertTrue("timed out while sending direct messages", org.junit.Assert.assertTrue("timed out while sending direct messages",
sentDirectLatch.await(30, TimeUnit.SECONDS)); sentDirectLatch.await(30, TimeUnit.SECONDS));
print("sending 1 direct message per node took %ss", print("sending 1 direct message per peer took %ss",
Duration.between(sendStart, Instant.now()).toMillis()/1000.0); Duration.between(sendStart, Instant.now()).toMillis()/1000.0);
org.junit.Assert.assertFalse("some peer(s) failed to send a direct message", sentDirectFailed.get()); org.junit.Assert.assertFalse("some peer(s) failed to send a direct message", sentDirectFailed.get());
} }