@@ -12,13 +12,12 @@ def setup
12
12
@controller = ClusterController . new (
13
13
TEST_NODE_URIS ,
14
14
replica_size : TEST_REPLICA_SIZE ,
15
- **TEST_GENERIC_OPTIONS . merge ( timeout : 30.0 )
15
+ **TEST_GENERIC_OPTIONS
16
16
)
17
17
@controller . rebuild
18
18
@captured_commands = ::Middlewares ::CommandCapture ::CommandBuffer . new
19
19
@redirect_count = ::Middlewares ::RedirectCount ::Counter . new
20
- @client = new_test_client
21
- @client . call ( 'echo' , 'init' )
20
+ @client = new_test_client . tap { |c | c . call ( 'echo' , 'init' ) }
22
21
@captured_commands . clear
23
22
@redirect_count . clear
24
23
end
@@ -30,18 +29,11 @@ def teardown
30
29
"ClusterNodesCall: #{ @captured_commands . count ( 'cluster' , 'nodes' ) } = "
31
30
end
32
31
33
- def test_the_state_of_cluster_down
34
- @controller . down
35
- assert_raises ( ::RedisClient ::CommandError ) { @client . call ( 'SET' , 'key1' , 1 ) }
36
- assert_equal ( 'fail' , fetch_cluster_info ( 'cluster_state' ) )
37
- end
38
-
39
32
def test_the_state_of_cluster_failover
40
33
@controller . failover
41
34
1000 . times { |i | assert_equal ( 'OK' , @client . call ( 'SET' , "key#{ i } " , i ) ) }
42
35
wait_for_replication
43
36
1000 . times { |i | assert_equal ( i . to_s , @client . call ( 'GET' , "key#{ i } " ) ) }
44
- assert_equal ( 'ok' , fetch_cluster_info ( 'cluster_state' ) )
45
37
refute ( @redirect_count . zero? , @redirect_count . get )
46
38
end
47
39
@@ -242,10 +234,6 @@ def wait_for_replication
242
234
end
243
235
end
244
236
245
- def fetch_cluster_info ( key )
246
- @client . call ( 'CLUSTER' , 'INFO' ) . split ( "\r \n " ) . to_h { |v | v . split ( ':' ) } . fetch ( key )
247
- end
248
-
249
237
def do_resharding_test ( number_of_keys : 1000 )
250
238
@client . pipelined { |pipeline | number_of_keys . times { |i | pipeline . call ( 'SET' , "key#{ i } " , "key#{ i } " ) } }
251
239
wait_for_replication
0 commit comments