From 2452ae2a670ebce04a1accac08337a8f5c1c5237 Mon Sep 17 00:00:00 2001 From: Taishi Kasuga Date: Sat, 13 Apr 2024 07:48:04 +0900 Subject: [PATCH 1/2] Fix a test case for the cluster related to the permission issue --- test/helper.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/helper.rb b/test/helper.rb index dc4ebf33..d3fb5290 100644 --- a/test/helper.rb +++ b/test/helper.rb @@ -174,7 +174,7 @@ def version def with_acl admin = _new_client admin.acl('SETUSER', 'johndoe', 'on', - '+ping', '+select', '+command', '+cluster|slots', '+cluster|nodes', + '+ping', '+select', '+command', '+cluster|slots', '+cluster|nodes', '+readonly', '>mysecret') yield('johndoe', 'mysecret') ensure From e95acbe63605dc2edbe01ba35354062e5a49ca85 Mon Sep 17 00:00:00 2001 From: Taishi Kasuga Date: Sat, 13 Apr 2024 07:57:29 +0900 Subject: [PATCH 2/2] fix --- cluster/test/commands_on_transactions_test.rb | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/cluster/test/commands_on_transactions_test.rb b/cluster/test/commands_on_transactions_test.rb index 7935ba4a..182144f5 100644 --- a/cluster/test/commands_on_transactions_test.rb +++ b/cluster/test/commands_on_transactions_test.rb @@ -38,8 +38,11 @@ def test_unwatch end def test_watch - assert_raises(Redis::CommandError, "CROSSSLOT Keys in request don't hash to the same slot") do - redis.watch('key1', 'key2') + assert_raises(Redis::Cluster::TransactionConsistencyError) do + redis.watch('key1', 'key2') do |tx| + tx.set('key1', '1') + tx.set('key2', '2') + end end assert_equal 'OK', redis.watch('{key}1', '{key}2')