[PAN-2369] RunnerTest fail on Windows due to network startup timing issue (#1005)

[PAN-2369] RunnerTest fail on Windows due to network startup timing issue
* Forces RunnerTest to wait for the P2PNetwork to start and actually configure it's ports before asking for them.
* Re-Enables RunnerTest.fullSyncFromGenesis()
* Re-Enables RunnerTest.fastSyncFromGenesis()


Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
pull/2/head
Eric Kellstrand 6 years ago committed by GitHub
parent 60e233dc7f
commit 2f495b5950
  1. 13
      pantheon/src/test/java/tech/pegasys/pantheon/RunnerTest.java

@ -67,7 +67,6 @@ import okhttp3.RequestBody;
import okhttp3.Response; import okhttp3.Response;
import org.assertj.core.api.Assertions; import org.assertj.core.api.Assertions;
import org.awaitility.Awaitility; import org.awaitility.Awaitility;
import org.junit.Ignore;
import org.junit.Rule; import org.junit.Rule;
import org.junit.Test; import org.junit.Test;
import org.junit.rules.TemporaryFolder; import org.junit.rules.TemporaryFolder;
@ -78,13 +77,11 @@ public final class RunnerTest {
@Rule public final TemporaryFolder temp = new TemporaryFolder(); @Rule public final TemporaryFolder temp = new TemporaryFolder();
@Test @Test
@Ignore
public void fullSyncFromGenesis() throws Exception { public void fullSyncFromGenesis() throws Exception {
syncFromGenesis(SyncMode.FULL); syncFromGenesis(SyncMode.FULL);
} }
@Test @Test
@Ignore
public void fastSyncFromGenesis() throws Exception { public void fastSyncFromGenesis() throws Exception {
syncFromGenesis(SyncMode.FAST); syncFromGenesis(SyncMode.FAST);
} }
@ -158,6 +155,16 @@ public final class RunnerTest {
executorService.submit(runnerAhead::execute); executorService.submit(runnerAhead::execute);
// Wait for network to initialize to get the P2P UDP port
Awaitility.await()
.atMost(20, TimeUnit.SECONDS)
.ignoreExceptions()
.untilAsserted(() -> assertThat(runnerAhead.getP2pUdpPort()).isNotNull());
Awaitility.await()
.atMost(20, TimeUnit.SECONDS)
.ignoreExceptions()
.untilAsserted(() -> assertThat(runnerAhead.getP2pTcpPort()).isNotNull());
final SynchronizerConfiguration syncConfigBehind = final SynchronizerConfiguration syncConfigBehind =
SynchronizerConfiguration.builder() SynchronizerConfiguration.builder()
.syncMode(mode) .syncMode(mode)

Loading…
Cancel
Save