File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
redis/src/test/scala/com/avsystem/commons/redis Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -26,7 +26,15 @@ trait UsesPreconfiguredCluster extends UsesActorSystem with UsesClusterServers {
2626
2727 val clients = addresses.map(addr => new RedisConnectionClient (addr))
2828 val commands = clients.map(client => RedisApi .Connection .Async .BinaryTyped (client))
29- val initFuture = Future .traverse(commands)(c => waitUntil(c.clusterInfo.map(_.stateOk), 500 .millis))
29+ val initFuture = Future .traverse(commands) { c =>
30+ waitUntil(
31+ for {
32+ stateOk <- c.clusterInfo.map(_.stateOk)
33+ slavesHaveSlots <- c.clusterSlots.map(_.forall(_.slaves.nonEmpty))
34+ } yield stateOk && slavesHaveSlots,
35+ 500 .millis,
36+ )
37+ }
3038
3139 Await .result(initFuture, 30 .seconds)
3240
You can’t perform that action at this time.
0 commit comments