mirror of
https://github.com/corda/corda.git
synced 2025-06-21 08:40:03 +00:00
Fix RPC flaky test (#2849)
* fix rpc reconnect flaky test; remove obsolete rpcproxy log message * rpc client proxy: replace lock with atomic variable * rpc client proxy: removed volatile property * RPCStabilityTests: used eventually() method to test async response * RPCStabilityTests: remove unused import
This commit is contained in:
@ -12,6 +12,7 @@ import net.corda.core.serialization.serialize
|
||||
import net.corda.core.utilities.*
|
||||
import net.corda.node.services.messaging.RPCServerConfiguration
|
||||
import net.corda.nodeapi.RPCApi
|
||||
import net.corda.nodeapi.eventually
|
||||
import net.corda.testing.core.SerializationEnvironmentRule
|
||||
import net.corda.testing.internal.testThreadFactory
|
||||
import net.corda.testing.node.internal.*
|
||||
@ -247,9 +248,8 @@ class RPCStabilityTests {
|
||||
assertEquals("pong", client.ping())
|
||||
serverFollower.shutdown()
|
||||
startRpcServer<ReconnectOps>(ops = ops, customPort = serverPort).getOrThrow()
|
||||
Thread.sleep(1000) //wait for the server to come back up
|
||||
val pingFuture = pool.fork(client::ping)
|
||||
assertEquals("pong", pingFuture.getOrThrow(10.seconds))
|
||||
val response = eventually<RPCException, String>(10.seconds) { client.ping() }
|
||||
assertEquals("pong", response)
|
||||
clientFollower.shutdown() // Driver would do this after the new server, causing hang.
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user