CORDA-4045 Adjust test to remove scope for race conditions (#6769)

Change assertion in `Restart does not set senderUUID` to verify a single message has a sender UUID set, rather than the last to be recorded as sent has no sender UUID.
This commit is contained in:
Ross Nicoll 2020-10-14 13:44:41 +01:00 committed by GitHub
parent 2790e945c6
commit eb65cdc08a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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)