diff --git a/node/src/test/kotlin/net/corda/node/services/statemachine/RetryFlowMockTest.kt b/node/src/test/kotlin/net/corda/node/services/statemachine/RetryFlowMockTest.kt index e30462d2bf..a3bb5d520a 100644 --- a/node/src/test/kotlin/net/corda/node/services/statemachine/RetryFlowMockTest.kt +++ b/node/src/test/kotlin/net/corda/node/services/statemachine/RetryFlowMockTest.kt @@ -126,7 +126,9 @@ class RetryFlowMockTest { ReceiveFlow3.lock.release() assertTrue(expectedMessagesSent.await(20, TimeUnit.SECONDS)) assertEquals(3, messagesSent.size) - assertNull(messagesSent.last().senderUUID) + // CORDA-4045: We can't be sure that the last message sent will be the last we record, so + // instead check we have exactly one message (the first) with sender UUID + assertNotNull(messagesSent.singleOrNull { it.senderUUID != null }) } @Test(timeout=300_000)