Remove useless call to waitUntilNetworkReady within driver started nodes (#1998)

Remove usages of waitUntilNetworkReady in conjunction with driver
This commit is contained in:
Alberto Arri 2017-11-03 14:27:46 +00:00 committed by GitHub
parent 22453204ed
commit 9be37c2b88
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 5 additions and 19 deletions

View File

@ -11,8 +11,8 @@ import net.corda.finance.DOLLARS
import net.corda.finance.contracts.asset.Cash
import net.corda.finance.flows.CashIssueFlow
import net.corda.finance.flows.CashPaymentFlow
import net.corda.node.services.Permissions.Companion.startFlow
import net.corda.node.services.Permissions.Companion.invokeRpc
import net.corda.node.services.Permissions.Companion.startFlow
import net.corda.nodeapi.User
import net.corda.testing.*
import net.corda.testing.driver.driver
@ -28,14 +28,12 @@ class IntegrationTestingTutorial {
val aliceUser = User("aliceUser", "testPassword1", permissions = setOf(
startFlow<CashIssueFlow>(),
startFlow<CashPaymentFlow>(),
invokeRpc(CordaRPCOps::waitUntilNetworkReady),
invokeRpc("vaultTrackBy"),
invokeRpc(CordaRPCOps::notaryIdentities),
invokeRpc(CordaRPCOps::networkMapFeed)
))
val bobUser = User("bobUser", "testPassword2", permissions = setOf(
startFlow<CashPaymentFlow>(),
invokeRpc(CordaRPCOps::waitUntilNetworkReady),
invokeRpc("vaultTrackBy"),
invokeRpc(CordaRPCOps::networkMapFeed)
))
@ -44,6 +42,7 @@ class IntegrationTestingTutorial {
startNode(providedName = ALICE.name, rpcUsers = listOf(aliceUser)),
startNode(providedName = BOB.name, rpcUsers = listOf(bobUser))
).transpose().getOrThrow()
// END 1
// START 2
@ -52,9 +51,6 @@ class IntegrationTestingTutorial {
val bobClient = bob.rpcClientToNode()
val bobProxy = bobClient.start("bobUser", "testPassword2").proxy
aliceProxy.waitUntilNetworkReady().getOrThrow()
bobProxy.waitUntilNetworkReady().getOrThrow()
// END 2
// START 3

View File

@ -8,14 +8,13 @@ import net.corda.core.serialization.CordaSerializable
import net.corda.core.serialization.SerializationWhitelist
import net.corda.core.transactions.SignedTransaction
import net.corda.core.utilities.OpaqueBytes
import net.corda.core.utilities.getOrThrow
import net.corda.finance.USD
import net.corda.finance.contracts.asset.Cash
import net.corda.finance.flows.CashExitFlow
import net.corda.finance.flows.CashIssueFlow
import net.corda.finance.flows.CashPaymentFlow
import net.corda.node.services.Permissions.Companion.startFlow
import net.corda.node.services.Permissions.Companion.invokeRpc
import net.corda.node.services.Permissions.Companion.startFlow
import net.corda.nodeapi.User
import net.corda.testing.ALICE
import net.corda.testing.DUMMY_NOTARY
@ -56,7 +55,6 @@ fun main(args: Array<String>) {
// START 2
val client = node.rpcClientToNode()
val proxy = client.start("user", "password").proxy
proxy.waitUntilNetworkReady().getOrThrow()
thread {
generateTransactions(proxy)

View File

@ -68,7 +68,6 @@ class AttachmentLoadingTests {
startNode(providedName = bankAName, rpcUsers = listOf(adminUser)),
startNode(providedName = bankBName, rpcUsers = listOf(adminUser))
).transpose().getOrThrow() // Wait for all nodes to start up.
nodes.forEach { it.rpc.waitUntilNetworkReady().getOrThrow() }
return nodes
}

View File

@ -8,8 +8,8 @@ import net.corda.core.utilities.getOrThrow
import net.corda.finance.DOLLARS
import net.corda.finance.contracts.asset.Cash
import net.corda.finance.flows.CashIssueAndPaymentFlow
import net.corda.node.services.Permissions.Companion.startFlow
import net.corda.node.services.Permissions.Companion.invokeRpc
import net.corda.node.services.Permissions.Companion.startFlow
import net.corda.nodeapi.User
import net.corda.testing.*
import net.corda.testing.driver.driver
@ -20,7 +20,6 @@ class BankOfCordaRPCClientTest {
fun `issuer flow via RPC`() {
val commonPermissions = setOf(
invokeRpc("vaultTrackByCriteria"),
invokeRpc(CordaRPCOps::waitUntilNetworkReady),
invokeRpc(CordaRPCOps::wellKnownPartyFromX500Name),
invokeRpc(CordaRPCOps::notaryIdentities)
)
@ -40,8 +39,6 @@ class BankOfCordaRPCClientTest {
// Big Corporation RPC Client
val bigCorpClient = nodeBigCorporation.rpcClientToNode()
val bigCorpProxy = bigCorpClient.start("bigCorpCFO", "password2").proxy
bocProxy.waitUntilNetworkReady().getOrThrow()
bigCorpProxy.waitUntilNetworkReady().getOrThrow()
// Register for Bank of Corda Vault updates
val criteria = QueryCriteria.VaultQueryCriteria(status = Vault.StateStatus.ALL)

View File

@ -960,7 +960,7 @@ class DriverDSL(
if (process.isAlive) null else process
}
establishRpc(configuration, processDeathFuture).flatMap { rpc ->
// Call waitUntilNetworkReady in background in case RPC is failing over:
// Check for all nodes to have all other nodes in background in case RPC is failing over:
val forked = executorService.fork {
allNodesConnected(rpc)
}

View File

@ -127,10 +127,6 @@ class ExplorerSimulation(val options: OptionSet) {
bobNode.nodeInfo.legalIdentities.first() to bobRPC,
issuerNodeGBP.nodeInfo.legalIdentities.first() to issuerRPCGBP,
issuerNodeUSD.nodeInfo.legalIdentities.first() to issuerRPCUSD))
listOf(aliceRPC, bobRPC, issuerRPCGBP, issuerRPCUSD).map {
it.waitUntilNetworkReady().getOrThrow()
}
}
private fun startSimulation(eventGenerator: EventGenerator, maxIterations: Int) {