From 3b8495e9e311b7216df137fda5d7f5ce40106a2e Mon Sep 17 00:00:00 2001 From: Taishi Kasuga Date: Sat, 28 Mar 2020 14:41:55 +0900 Subject: [PATCH 1/2] Fix a unstable test case and resolve #895 --- test/distributed_remote_server_control_commands_test.rb | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/test/distributed_remote_server_control_commands_test.rb b/test/distributed_remote_server_control_commands_test.rb index 8947007e7..c6c4778de 100644 --- a/test/distributed_remote_server_control_commands_test.rb +++ b/test/distributed_remote_server_control_commands_test.rb @@ -28,11 +28,13 @@ def test_info def test_info_commandstats target_version "2.5.7" do - r.nodes.each { |n| n.config(:resetstat) } - r.ping # Executed on every node + r.nodes.each do |n| + n.config(:resetstat) + n.config(:get, :port) + end r.info(:commandstats).each do |info| - assert_equal "1", info["ping"]["calls"] + assert_equal '2', info['config']['calls'] # CONFIG RESETSTAT + CONFIG GET = twice end end end From a165deb777b85613d3e5e5e9dcf49f054ae050b2 Mon Sep 17 00:00:00 2001 From: Taishi Kasuga Date: Sat, 28 Mar 2020 15:13:00 +0900 Subject: [PATCH 2/2] Since Sentinel keeps monitoring by ping, change commandstats key for test. --- test/remote_server_control_commands_test.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/remote_server_control_commands_test.rb b/test/remote_server_control_commands_test.rb index a9749a506..0a9560203 100644 --- a/test/remote_server_control_commands_test.rb +++ b/test/remote_server_control_commands_test.rb @@ -27,10 +27,10 @@ def test_info def test_info_commandstats target_version "2.5.7" do r.config(:resetstat) - r.ping + r.config(:get, :port) result = r.info(:commandstats) - assert_equal "1", result["ping"]["calls"] + assert_equal '2', result['config']['calls'] end end