CORDA-2942: Remove multiple reps from the test (#5893)

... as it is proven to be stable now.
This commit is contained in:
Viktor Kolomeyko 2020-01-24 16:57:31 +00:00 committed by Rick Parker
parent 3027483b10
commit a4d63d1329

View File

@ -63,34 +63,29 @@ class CordaServiceLifecycleFatalTests {
@Test @Test
fun `JVM terminates on critical failure`() { fun `JVM terminates on critical failure`() {
(1..20).forEach { // Scenario terminates JVM - node should be running out of process
driver(DriverParameters(startNodesInProcess = false, cordappsForAllNodes = listOf(enclosedCordapp()),
notarySpecs = emptyList(),
systemProperties = mapOf(SECRET_PROPERTY_NAME to "true", tempFilePropertyName to tmpFile.absolutePath))) {
val nodeHandle = startNode(providedName = ALICE_NAME).getOrThrow()
logger.info("Rep #$it") val rpcInterface = nodeHandle.rpc
eventually(duration = 60.seconds) {
assertEquals(readyToThrowMarker, tmpFile.readLines().last())
}
// Scenario terminates JVM - node should be running out of process rpcInterface.protocolVersion
driver(DriverParameters(startNodesInProcess = false, cordappsForAllNodes = listOf(enclosedCordapp()),
notarySpecs = emptyList(),
systemProperties = mapOf(SECRET_PROPERTY_NAME to "true", tempFilePropertyName to tmpFile.absolutePath))) {
val nodeHandle = startNode(providedName = ALICE_NAME).getOrThrow()
val rpcInterface = nodeHandle.rpc tmpFile.appendText("\n" + goodToThrowMarker)
eventually(duration = 60.seconds) {
assertEquals(readyToThrowMarker, tmpFile.readLines().last())
}
rpcInterface.protocolVersion // We signalled that it is good to throw which will eventually trigger node shutdown and RPC interface no longer working.
eventually(duration = 30.seconds) {
tmpFile.appendText("\n" + goodToThrowMarker) assertFailsWith(Exception::class) {
try {
// We signalled that it is good to throw which will eventually trigger node shutdown and RPC interface no longer working. rpcInterface.protocolVersion
eventually(duration = 30.seconds) { } catch (ex: Exception) {
assertFailsWith(Exception::class) { logger.info("Thrown as expected", ex)
try { throw ex
rpcInterface.protocolVersion
} catch (ex: Exception) {
logger.info("Thrown as expected", ex)
throw ex
}
} }
} }
} }