From 0f92f4abe25cf15195c25e3ac91dbcf065962735 Mon Sep 17 00:00:00 2001 From: Taishi Kasuga Date: Mon, 30 Sep 2024 17:49:31 +0900 Subject: [PATCH] test: remove a redundant case --- test/test_against_cluster_state.rb | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/test/test_against_cluster_state.rb b/test/test_against_cluster_state.rb index 0eb606b..5ebdeb2 100644 --- a/test/test_against_cluster_state.rb +++ b/test/test_against_cluster_state.rb @@ -12,13 +12,12 @@ def setup @controller = ClusterController.new( TEST_NODE_URIS, replica_size: TEST_REPLICA_SIZE, - **TEST_GENERIC_OPTIONS.merge(timeout: 30.0) + **TEST_GENERIC_OPTIONS ) @controller.rebuild @captured_commands = ::Middlewares::CommandCapture::CommandBuffer.new @redirect_count = ::Middlewares::RedirectCount::Counter.new - @client = new_test_client - @client.call('echo', 'init') + @client = new_test_client.tap { |c| c.call('echo', 'init') } @captured_commands.clear @redirect_count.clear end @@ -30,18 +29,11 @@ def teardown "ClusterNodesCall: #{@captured_commands.count('cluster', 'nodes')} = " end - def test_the_state_of_cluster_down - @controller.down - assert_raises(::RedisClient::CommandError) { @client.call('SET', 'key1', 1) } - assert_equal('fail', fetch_cluster_info('cluster_state')) - end - def test_the_state_of_cluster_failover @controller.failover 1000.times { |i| assert_equal('OK', @client.call('SET', "key#{i}", i)) } wait_for_replication 1000.times { |i| assert_equal(i.to_s, @client.call('GET', "key#{i}")) } - assert_equal('ok', fetch_cluster_info('cluster_state')) refute(@redirect_count.zero?, @redirect_count.get) end @@ -242,10 +234,6 @@ def wait_for_replication end end - def fetch_cluster_info(key) - @client.call('CLUSTER', 'INFO').split("\r\n").to_h { |v| v.split(':') }.fetch(key) - end - def do_resharding_test(number_of_keys: 1000) @client.pipelined { |pipeline| number_of_keys.times { |i| pipeline.call('SET', "key#{i}", "key#{i}") } } wait_for_replication