From 9891fb58b0680eeae95201de3849d172588c8402 Mon Sep 17 00:00:00 2001 From: Andras Slemmer Date: Wed, 30 Aug 2017 17:51:19 +0100 Subject: [PATCH] Address comments --- .../kotlin/net/corda/services/messaging/P2PMessagingTest.kt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/node/src/integration-test/kotlin/net/corda/services/messaging/P2PMessagingTest.kt b/node/src/integration-test/kotlin/net/corda/services/messaging/P2PMessagingTest.kt index 887419c2cb..e3af49da13 100644 --- a/node/src/integration-test/kotlin/net/corda/services/messaging/P2PMessagingTest.kt +++ b/node/src/integration-test/kotlin/net/corda/services/messaging/P2PMessagingTest.kt @@ -114,7 +114,7 @@ class P2PMessagingTest : NodeBasedTest() { send(msg, serviceAddress, retryId = request.sessionID) responseFuture } - crashingNodes.firstRequestReceived.await() + crashingNodes.firstRequestReceived.await(5, TimeUnit.SECONDS) // The request wasn't successful. assertThat(responseFuture.isDone).isFalse() crashingNodes.ignoreRequests = false @@ -148,7 +148,7 @@ class P2PMessagingTest : NodeBasedTest() { // Wait until the first request is received crashingNodes.firstRequestReceived.await(5, TimeUnit.SECONDS) - // Stop alice's node before the request is redelivered – the first request is ignored + // Stop alice's node after we ensured that the first request was delivered and ignored. alice.stop() val numberOfRequestsReceived = crashingNodes.requestsReceived.get() assertThat(numberOfRequestsReceived).isGreaterThanOrEqualTo(1) @@ -159,7 +159,7 @@ class P2PMessagingTest : NodeBasedTest() { val aliceRestarted = startNode(ALICE.name, configOverrides = mapOf("messageRedeliveryDelaySeconds" to 1)).getOrThrow() val response = aliceRestarted.network.onNext(dummyTopic, sessionId).getOrThrow(5.seconds) - assertThat(crashingNodes.requestsReceived.get()).isGreaterThanOrEqualTo(numberOfRequestsReceived + 1) + assertThat(crashingNodes.requestsReceived.get()).isGreaterThan(numberOfRequestsReceived) assertThat(response).isEqualTo(responseMessage) }