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