Skip to content
This repository has been archived by the owner on Sep 26, 2019. It is now read-only.

Commit

Permalink
[PAN-2369] RunnerTest fail on Windows due to network startup timing i…
Browse files Browse the repository at this point in the history
…ssue (#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()
  • Loading branch information
ekellstrand authored Feb 27, 2019
1 parent 74388bf commit a34d961
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions pantheon/src/test/java/tech/pegasys/pantheon/RunnerTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@
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;
Expand All @@ -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);
}
Expand Down Expand Up @@ -158,6 +155,16 @@ private void syncFromGenesis(final SyncMode mode) throws Exception {

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)
Expand Down

0 comments on commit a34d961

Please sign in to comment.