diff --git a/node/src/integration-test/kotlin/net/corda/node/services/events/ScheduledFlowIntegrationTests.kt b/node/src/integration-test/kotlin/net/corda/node/services/events/ScheduledFlowIntegrationTests.kt index 8f2bc0af24..a8c2f6fb61 100644 --- a/node/src/integration-test/kotlin/net/corda/node/services/events/ScheduledFlowIntegrationTests.kt +++ b/node/src/integration-test/kotlin/net/corda/node/services/events/ScheduledFlowIntegrationTests.kt @@ -89,18 +89,15 @@ class ScheduledFlowIntegrationTests { private fun MutableList>.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>() @@ -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())