INFRA-687 Change to use an out of process node (#6696)

* Change to use an out of process node
* Remove exception swallowing and add package for test constants to test process
This commit is contained in:
Ben McMahon 2020-10-05 18:12:31 +01:00 committed by GitHub
parent ee8f4ce733
commit 2790e945c6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -89,18 +89,15 @@ class ScheduledFlowIntegrationTests {
private fun MutableList<CordaFuture<*>>.getOrThrowAll() {
forEach {
try {
it.getOrThrow()
} catch (ex: Exception) {
}
it.getOrThrow()
}
}
@Test(timeout=300_000)
fun `test that when states are being spent at the same time that schedules trigger everything is processed`() {
driver(DriverParameters(
startNodesInProcess = true,
cordappsForAllNodes = listOf(DUMMY_CONTRACTS_CORDAPP, cordappWithPackages("net.corda.testMessage"), enclosedCordapp())
startNodesInProcess = false,
cordappsForAllNodes = listOf(DUMMY_CONTRACTS_CORDAPP, cordappWithPackages("net.corda.testMessage", "net.corda.testing.core"), enclosedCordapp())
)) {
val N = 23
val rpcUser = User("admin", "admin", setOf("ALL"))
@ -127,6 +124,7 @@ class ScheduledFlowIntegrationTests {
scheduledFor
).returnValue)
}
initialiseFutures.getOrThrowAll()
val spendAttemptFutures = mutableListOf<CordaFuture<*>>()
@ -134,6 +132,7 @@ class ScheduledFlowIntegrationTests {
spendAttemptFutures.add(aliceClient.proxy.startFlow(::AnotherFlow, (i).toString()).returnValue)
spendAttemptFutures.add(bobClient.proxy.startFlow(::AnotherFlow, (i + 100).toString()).returnValue)
}
spendAttemptFutures.getOrThrowAll()
// TODO: the queries below are not atomic so we need to allow enough time for the scheduler to finish. Would be better to query scheduler.
@ -144,7 +143,7 @@ class ScheduledFlowIntegrationTests {
val bobStates = bobClient.proxy.vaultQuery(ScheduledState::class.java).states.filter { it.state.data.processed }
val bobSpentStates = bobClient.proxy.vaultQuery(SpentState::class.java).states
assertEquals(aliceStates.count() + aliceSpentStates.count(), N * 2)
assertEquals(bobStates.count() + bobSpentStates.count(), N * 2)
assertEquals(aliceSpentStates.count(), bobSpentStates.count())