mirror of
https://github.com/corda/corda.git
synced 2025-01-18 10:46:38 +00:00
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:
parent
ee8f4ce733
commit
2790e945c6
@ -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())
|
||||
|
Loading…
Reference in New Issue
Block a user