@@ -47,15 +47,15 @@ func (s *clusterScenario) addrs() []string {
4747 return addrs
4848}
4949
50- func (s * clusterScenario ) newClusterClientUnsafe (opt * redis.ClusterOptions ) * redis.ClusterClient {
50+ func (s * clusterScenario ) newClusterClientUnstable (opt * redis.ClusterOptions ) * redis.ClusterClient {
5151 opt .Addrs = s .addrs ()
5252 return redis .NewClusterClient (opt )
5353}
5454
5555func (s * clusterScenario ) newClusterClient (
5656 ctx context.Context , opt * redis.ClusterOptions ,
5757) * redis.ClusterClient {
58- client := s .newClusterClientUnsafe (opt )
58+ client := s .newClusterClientUnstable (opt )
5959
6060 err := eventually (func () error {
6161 if opt .ClusterSlots != nil {
@@ -873,59 +873,6 @@ var _ = Describe("ClusterClient", func() {
873873 assertClusterClient ()
874874 })
875875
876- Describe ("ClusterClient failover" , func () {
877- BeforeEach (func () {
878- failover = true
879-
880- opt = redisClusterOptions ()
881- opt .MinRetryBackoff = 250 * time .Millisecond
882- opt .MaxRetryBackoff = time .Second
883- client = cluster .newClusterClient (ctx , opt )
884-
885- err := client .ForEachMaster (ctx , func (ctx context.Context , master * redis.Client ) error {
886- return master .FlushDB (ctx ).Err ()
887- })
888- Expect (err ).NotTo (HaveOccurred ())
889-
890- err = client .ForEachSlave (ctx , func (ctx context.Context , slave * redis.Client ) error {
891- defer GinkgoRecover ()
892-
893- Eventually (func () int64 {
894- return slave .DBSize (ctx ).Val ()
895- }, "30s" ).Should (Equal (int64 (0 )))
896-
897- return nil
898- })
899- Expect (err ).NotTo (HaveOccurred ())
900-
901- state , err := client .LoadState (ctx )
902- Eventually (func () bool {
903- state , err = client .LoadState (ctx )
904- if err != nil {
905- return false
906- }
907- return state .IsConsistent (ctx )
908- }, "30s" ).Should (BeTrue ())
909-
910- for _ , slave := range state .Slaves {
911- err = slave .Client .ClusterFailover (ctx ).Err ()
912- Expect (err ).NotTo (HaveOccurred ())
913-
914- Eventually (func () bool {
915- state , _ := client .LoadState (ctx )
916- return state .IsConsistent (ctx )
917- }, "30s" ).Should (BeTrue ())
918- }
919- })
920-
921- AfterEach (func () {
922- failover = false
923- Expect (client .Close ()).NotTo (HaveOccurred ())
924- })
925-
926- assertClusterClient ()
927- })
928-
929876 Describe ("ClusterClient with RouteByLatency" , func () {
930877 BeforeEach (func () {
931878 opt = redisClusterOptions ()
@@ -1132,7 +1079,7 @@ var _ = Describe("ClusterClient with unavailable Cluster", func() {
11321079 opt .ReadTimeout = 250 * time .Millisecond
11331080 opt .WriteTimeout = 250 * time .Millisecond
11341081 opt .MaxRedirects = 1
1135- client = cluster .newClusterClientUnsafe (opt )
1082+ client = cluster .newClusterClientUnstable (opt )
11361083 })
11371084
11381085 AfterEach (func () {
0 commit comments