Skip to content

Commit 2212a8f

Browse files
authored
test: remove a redundant case (#392)
1 parent 5ad1397 commit 2212a8f

File tree

1 file changed

+2
-14
lines changed

1 file changed

+2
-14
lines changed

test/test_against_cluster_state.rb

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,12 @@ def setup
1212
@controller = ClusterController.new(
1313
TEST_NODE_URIS,
1414
replica_size: TEST_REPLICA_SIZE,
15-
**TEST_GENERIC_OPTIONS.merge(timeout: 30.0)
15+
**TEST_GENERIC_OPTIONS
1616
)
1717
@controller.rebuild
1818
@captured_commands = ::Middlewares::CommandCapture::CommandBuffer.new
1919
@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') }
2221
@captured_commands.clear
2322
@redirect_count.clear
2423
end
@@ -30,18 +29,11 @@ def teardown
3029
"ClusterNodesCall: #{@captured_commands.count('cluster', 'nodes')} = "
3130
end
3231

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-
3932
def test_the_state_of_cluster_failover
4033
@controller.failover
4134
1000.times { |i| assert_equal('OK', @client.call('SET', "key#{i}", i)) }
4235
wait_for_replication
4336
1000.times { |i| assert_equal(i.to_s, @client.call('GET', "key#{i}")) }
44-
assert_equal('ok', fetch_cluster_info('cluster_state'))
4537
refute(@redirect_count.zero?, @redirect_count.get)
4638
end
4739

@@ -242,10 +234,6 @@ def wait_for_replication
242234
end
243235
end
244236

245-
def fetch_cluster_info(key)
246-
@client.call('CLUSTER', 'INFO').split("\r\n").to_h { |v| v.split(':') }.fetch(key)
247-
end
248-
249237
def do_resharding_test(number_of_keys: 1000)
250238
@client.pipelined { |pipeline| number_of_keys.times { |i| pipeline.call('SET', "key#{i}", "key#{i}") } }
251239
wait_for_replication

0 commit comments

Comments
 (0)