Wait for next message to be sent in FullSyncChainDownloaderTest. (#1394)

Signed-off-by: Adrian Sutton <adrian.sutton@consensys.net>
pull/2/head
Adrian Sutton 6 years ago committed by GitHub
parent b918897eab
commit af002d4847
  1. 2
      ethereum/eth/src/test/java/tech/pegasys/pantheon/ethereum/eth/sync/fullsync/FullSyncChainDownloaderTest.java

@ -317,6 +317,8 @@ public class FullSyncChainDownloaderTest {
assertThat(syncState.syncTarget().get().peer()).isEqualTo(bestPeer.getEthPeer()); assertThat(syncState.syncTarget().get().peer()).isEqualTo(bestPeer.getEthPeer());
// The next message should be for checkpoint headers from the sync target // The next message should be for checkpoint headers from the sync target
Awaitility.waitAtMost(10, TimeUnit.SECONDS)
.until(() -> bestPeer.peekNextOutgoingRequest().isPresent());
final Optional<MessageData> maybeNextMessage = bestPeer.peekNextOutgoingRequest(); final Optional<MessageData> maybeNextMessage = bestPeer.peekNextOutgoingRequest();
assertThat(maybeNextMessage).isPresent(); assertThat(maybeNextMessage).isPresent();
final MessageData nextMessage = maybeNextMessage.get(); final MessageData nextMessage = maybeNextMessage.get();

Loading…
Cancel
Save