mirror of
https://github.com/bisq-network/bisq.git
synced 2025-02-24 23:18:17 +01:00
Wait for peer nodes bootstrap in network stress test
Once it threw a ``ConcurrentModificationException`` while shutting down but I've not been able to reproduce it, so keep an eye on it happening again.
This commit is contained in:
parent
fe9b3ec5f6
commit
1910b66aef
1 changed files with 7 additions and 1 deletions
|
@ -55,6 +55,8 @@ public class NetworkStressTest {
|
|||
|
||||
/** A barrier to wait for concurrent reception of preliminary data in peers. */
|
||||
private CountDownLatch prelimDataLatch = new CountDownLatch(NPEERS);
|
||||
/** A barrier to wait for concurrent bootstrap of peers. */
|
||||
private CountDownLatch bootstrapLatch = new CountDownLatch(NPEERS);
|
||||
|
||||
@Before
|
||||
public void setUp() throws Exception {
|
||||
|
@ -146,7 +148,8 @@ public class NetworkStressTest {
|
|||
|
||||
@Override
|
||||
public void onBootstrapComplete() {
|
||||
// do nothing
|
||||
// successful result
|
||||
NetworkStressTest.this.bootstrapLatch.countDown();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -195,6 +198,9 @@ public class NetworkStressTest {
|
|||
// Wait for peers to get their preliminary data.
|
||||
org.junit.Assert.assertTrue("timed out while waiting for preliminary data",
|
||||
prelimDataLatch.await(30, TimeUnit.SECONDS));
|
||||
// Wait for peers to complete their bootstrapping.
|
||||
org.junit.Assert.assertTrue("timed out while waiting for bootstrap",
|
||||
bootstrapLatch.await(30, TimeUnit.SECONDS));
|
||||
}
|
||||
|
||||
private Path createTempDirectory() throws IOException {
|
||||
|
|
Loading…
Add table
Reference in a new issue