Fix tests that check ports are bound/unbound (#756)

* Specifically, DriverTests and WebserverDriverTests
* RPCDriver.startRpcBroker now waits for port to be unbound, as was probably intended
* Explicitly drop network map future while ensuring the error is logged
This commit is contained in:
Andrzej Cichocki
2017-05-31 17:12:25 +01:00
committed by GitHub
parent 39fdb353ad
commit 4bd38d381a
6 changed files with 42 additions and 12 deletions

View File

@ -419,7 +419,7 @@ data class RPCDriverDSL(
server.start()
driverDSL.shutdownManager.registerShutdown {
server.stop()
addressMustNotBeBound(driverDSL.executorService, hostAndPort).get()
addressMustNotBeBound(driverDSL.executorService, hostAndPort)
}
RpcBrokerHandle(
hostAndPort = hostAndPort,

View File

@ -11,7 +11,7 @@ import net.corda.core.node.services.ServiceType
import net.corda.core.utilities.DUMMY_CA
import net.corda.core.utilities.DUMMY_MAP
import net.corda.core.utilities.WHITESPACE
import net.corda.node.driver.addressMustNotBeBound
import net.corda.node.driver.addressMustNotBeBoundFuture
import net.corda.node.internal.Node
import net.corda.node.services.config.ConfigHelper
import net.corda.node.services.config.FullNodeConfiguration
@ -62,8 +62,8 @@ abstract class NodeBasedTest {
// Wait until ports are released
val portNotBoundChecks = nodes.flatMap {
listOf(
it.configuration.p2pAddress.let { addressMustNotBeBound(shutdownExecutor, it) },
it.configuration.rpcAddress?.let { addressMustNotBeBound(shutdownExecutor, it) }
it.configuration.p2pAddress.let { addressMustNotBeBoundFuture(shutdownExecutor, it) },
it.configuration.rpcAddress?.let { addressMustNotBeBoundFuture(shutdownExecutor, it) }
)
}.filterNotNull()
nodes.clear()