summaryrefslogtreecommitdiff
path: root/tests/cluster
diff options
context:
space:
mode:
authorOran Agra <oran@redislabs.com>2021-01-02 08:37:19 +0200
committerGitHub <noreply@github.com>2021-01-02 08:37:19 +0200
commit71fbe6e800a10dabc81b1aec96bcca3b74af7bf4 (patch)
treeabed6571cb836f8ee4d99a73f7c1ec65abce8009 /tests/cluster
parent152b5d46c4a76f2d16031ef794092bfc8d322f8a (diff)
downloadredis-71fbe6e800a10dabc81b1aec96bcca3b74af7bf4.tar.gz
Fix leak in new errorstats commit, and a flaky test (#8278)
Diffstat (limited to 'tests/cluster')
-rw-r--r--tests/cluster/tests/18-info.tcl23
1 files changed, 16 insertions, 7 deletions
diff --git a/tests/cluster/tests/18-info.tcl b/tests/cluster/tests/18-info.tcl
index 83dbf833f..978d9d1da 100644
--- a/tests/cluster/tests/18-info.tcl
+++ b/tests/cluster/tests/18-info.tcl
@@ -26,11 +26,20 @@ test "errorstats: rejected call due to MOVED Redirection" {
$primary2 config resetstat
assert_match {} [errorstat $primary1 MOVED]
assert_match {} [errorstat $primary2 MOVED]
- # we know that the primary 2 will have a MOVED reply
- catch {$primary1 set key{0x0000} b} replyP1
- catch {$primary2 set key{0x0000} b} replyP2
- assert_match {OK} $replyP1
- assert_match {} [errorstat $primary1 MOVED]
- assert_match {*count=1*} [errorstat $primary2 MOVED]
- assert_match {*calls=0,*,rejected_calls=1,failed_calls=0} [cmdstat $primary2 set]
+ # we know that one will have a MOVED reply and one will succeed
+ catch {$primary1 set key b} replyP1
+ catch {$primary2 set key b} replyP2
+ # sort servers so we know which one failed
+ if {$replyP1 eq {OK}} {
+ assert_match {MOVED*} $replyP2
+ set pok $primary1
+ set perr $primary2
+ } else {
+ assert_match {MOVED*} $replyP1
+ set pok $primary2
+ set perr $primary1
+ }
+ assert_match {} [errorstat $pok MOVED]
+ assert_match {*count=1*} [errorstat $perr MOVED]
+ assert_match {*calls=0,*,rejected_calls=1,failed_calls=0} [cmdstat $perr set]
}