DistributedImmutableMapTest: enable copycat client connection retry to avoid race conditions

This commit is contained in:
Andrius Dagys 2016-12-01 13:21:25 +00:00
parent 3a52a3aa66
commit ad5d6f5cd4

View File

@ -2,6 +2,7 @@ package net.corda.node.services
import com.google.common.net.HostAndPort
import io.atomix.catalyst.transport.Address
import io.atomix.copycat.client.ConnectionStrategies
import io.atomix.copycat.client.CopycatClient
import io.atomix.copycat.server.CopycatServer
import io.atomix.copycat.server.storage.Storage
@ -105,7 +106,9 @@ class DistributedImmutableMapTests {
server.bootstrap()
}
val client = CopycatClient.builder(address).build()
val client = CopycatClient.builder(address)
.withConnectionStrategy(ConnectionStrategies.EXPONENTIAL_BACKOFF)
.build()
return serverInitFuture.thenCompose { client.connect(address) }.thenApply { Member(it, server) }
}
}