CORDA-3291 Support for new flow sleep in mock networks (#6200)

The new flow sleep made `NotaryWhitelistTests` flaky which highlighted
an issue with the change to how a flow sleeps. Messages were being
pumped while the flow was sleeping which lead to inconsistent behaviour.
Messages are no longer pumped while a flow sleeps.
This commit is contained in:
Dan Newton 2020-04-30 10:18:45 +01:00 committed by GitHub
parent 7309949abf
commit 66f241efe8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -550,7 +550,11 @@ open class InternalMockNetwork(cordappPackages: List<String> = emptyList(),
return allActiveFlows.any {
val flowState = it.snapshot().checkpoint.flowState
flowState is FlowState.Started && flowState.flowIORequest is FlowIORequest.ExecuteAsyncOperation
flowState is FlowState.Started && when (flowState.flowIORequest) {
is FlowIORequest.ExecuteAsyncOperation -> true
is FlowIORequest.Sleep -> true
else -> false
}
}
}