Skip to content

Commit

Permalink
Update sentinel tests for redis-client 0.14
Browse files Browse the repository at this point in the history
It now emits an extra query to refresh the sentinel list.
Mocks need an update.
  • Loading branch information
byroot committed May 22, 2023
1 parent e7285b0 commit 88bd367
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions test/sentinel/sentinel_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,9 @@ def test_sentinel_failover
commands[:s2] << [command, *args]
case command
when "get-master-addr-by-name"
["127.0.0.1", sentinels[0][:port].to_s]
["127.0.0.1", "6381"]
when "sentinels"
[
# ["ip", "127.0.0.1", "port", sentinels[0][:port].to_s],
# ["ip", "127.0.0.1", "port", sentinels[1][:port].to_s],
]
[]
else
raise "Unexpected command #{[command, *args].inspect}"
end
Expand All @@ -97,7 +94,7 @@ def test_sentinel_failover
end

assert_equal commands[:s1], [%w[get-master-addr-by-name master1]]
assert_equal commands[:s2], [%w[get-master-addr-by-name master1]]
assert_equal commands[:s2], [%w[get-master-addr-by-name master1], ["sentinels", "master1"]]
end

def test_sentinel_failover_prioritize_healthy_sentinel
Expand Down

0 comments on commit 88bd367

Please sign in to comment.