CORDA-1443: re-wrote tests to ensure connection closes before node to avoid lengthy artemis timeouts (#3104)

This commit is contained in:
bpaunescu 2018-05-10 09:42:48 +01:00 committed by GitHub
parent 3bb95c3ed1
commit 8419b24d80
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -35,14 +35,15 @@ class RpcSslTest {
withKeyStores(server, client) { nodeSslOptions, clientSslOptions -> withKeyStores(server, client) { nodeSslOptions, clientSslOptions ->
var successful = false var successful = false
driver(DriverParameters(isDebug = true, startNodesInProcess = true, portAllocation = RandomFree)) { driver(DriverParameters(isDebug = true, startNodesInProcess = true, portAllocation = RandomFree)) {
startNode(rpcUsers = listOf(user), customOverrides = nodeSslOptions.useSslRpcOverrides()).getOrThrow().use { node -> val node = startNode(rpcUsers = listOf(user), customOverrides = nodeSslOptions.useSslRpcOverrides()).getOrThrow()
createCordaRPCClientWithSsl(node.rpcAddress, sslConfiguration = clientSslOptions).start(user.username, user.password).use { connection -> val client = createCordaRPCClientWithSsl(node.rpcAddress, sslConfiguration = clientSslOptions)
connection.proxy.apply { val connection = client.start(user.username, user.password)
nodeInfo() connection.proxy.apply {
successful = true nodeInfo()
} successful = true
}
} }
connection.close()
} }
assertThat(successful).isTrue() assertThat(successful).isTrue()
} }
@ -54,14 +55,15 @@ class RpcSslTest {
val user = User("mark", "dadada", setOf(all())) val user = User("mark", "dadada", setOf(all()))
var successful = false var successful = false
driver(DriverParameters(isDebug = true, startNodesInProcess = true, portAllocation = RandomFree)) { driver(DriverParameters(isDebug = true, startNodesInProcess = true, portAllocation = RandomFree)) {
startNode(rpcUsers = listOf(user)).getOrThrow().use { node -> val node = startNode(rpcUsers = listOf(user)).getOrThrow()
CordaRPCClient(node.rpcAddress).start(user.username, user.password).use { connection -> val client = CordaRPCClient(node.rpcAddress)
connection.proxy.apply { val connection = client.start(user.username, user.password)
nodeInfo() connection.proxy.apply {
successful = true nodeInfo()
} successful = true
}
} }
connection.close()
} }
assertThat(successful).isTrue() assertThat(successful).isTrue()
} }