Wait for preliminary data and bootstrap to setup of network stress tests

This commit is contained in:
Ivan Vilata-i-Balaguer 2016-05-10 17:31:58 +02:00
parent 444f9d90b8
commit ad6c0599f6

View file

@ -164,6 +164,16 @@ public class NetworkStressTest {
} }
print("all local nodes started"); print("all local nodes started");
// Wait for peers to get their preliminary data.
assertLatch("timed out while waiting for preliminary data",
prelimDataLatch, 30, TimeUnit.SECONDS);
print("preliminary data received");
// Wait for peers to complete their bootstrapping.
assertLatch("timed out while waiting for bootstrap",
bootstrapLatch, 30, TimeUnit.SECONDS);
print("bootstrap complete");
} }
@NotNull @NotNull
@ -221,15 +231,6 @@ public class NetworkStressTest {
@Test @Test
public void test() throws InterruptedException { public void test() throws InterruptedException {
// Wait for peers to get their preliminary data.
assertLatch("timed out while waiting for preliminary data",
prelimDataLatch, 30, TimeUnit.SECONDS);
print("preliminary data received");
// Wait for peers to complete their bootstrapping.
assertLatch("timed out while waiting for bootstrap",
bootstrapLatch, 30, TimeUnit.SECONDS);
print("bootstrap complete");
// Test each peer sending a direct message to another random peer. // Test each peer sending a direct message to another random peer.
final int nPeers = peerNodes.size(); final int nPeers = peerNodes.size();
BooleanProperty sentDirectFailed = new SimpleBooleanProperty(false); BooleanProperty sentDirectFailed = new SimpleBooleanProperty(false);