diff options
author | Oran Agra <oran@redislabs.com> | 2021-01-02 08:37:19 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-02 08:37:19 +0200 |
commit | 71fbe6e800a10dabc81b1aec96bcca3b74af7bf4 (patch) | |
tree | abed6571cb836f8ee4d99a73f7c1ec65abce8009 /tests/cluster | |
parent | 152b5d46c4a76f2d16031ef794092bfc8d322f8a (diff) | |
download | redis-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.tcl | 23 |
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] } |