From 2f495b595021662dcdc7601ebd3e5be1f34f70cb Mon Sep 17 00:00:00 2001 From: Eric Kellstrand <34311165+ekellstrand@users.noreply.github.com> Date: Wed, 27 Feb 2019 17:16:56 -0500 Subject: [PATCH] [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 --- .../test/java/tech/pegasys/pantheon/RunnerTest.java | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/pantheon/src/test/java/tech/pegasys/pantheon/RunnerTest.java b/pantheon/src/test/java/tech/pegasys/pantheon/RunnerTest.java index 24f4cf435f..53eeec1e3d 100644 --- a/pantheon/src/test/java/tech/pegasys/pantheon/RunnerTest.java +++ b/pantheon/src/test/java/tech/pegasys/pantheon/RunnerTest.java @@ -67,7 +67,6 @@ import okhttp3.RequestBody; import okhttp3.Response; import org.assertj.core.api.Assertions; import org.awaitility.Awaitility; -import org.junit.Ignore; import org.junit.Rule; import org.junit.Test; import org.junit.rules.TemporaryFolder; @@ -78,13 +77,11 @@ public final class RunnerTest { @Rule public final TemporaryFolder temp = new TemporaryFolder(); @Test - @Ignore public void fullSyncFromGenesis() throws Exception { syncFromGenesis(SyncMode.FULL); } @Test - @Ignore public void fastSyncFromGenesis() throws Exception { syncFromGenesis(SyncMode.FAST); } @@ -158,6 +155,16 @@ public final class RunnerTest { 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 = SynchronizerConfiguration.builder() .syncMode(mode)