summaryrefslogtreecommitdiff
path: root/tests/support
diff options
context:
space:
mode:
authorBinbin <binloveplay1314@qq.com>2022-11-22 22:38:27 +0800
committerGitHub <noreply@github.com>2022-11-22 16:38:27 +0200
commit543e0daa6302f87478c660d2b96b2151afbf2c6a (patch)
tree6bf3094177fdeb0320e29a042593d5fbf0fc04d1 /tests/support
parent6e9724cb6a8ff2bad4c8aeb591ee0d14120ca7af (diff)
downloadredis-543e0daa6302f87478c660d2b96b2151afbf2c6a.tar.gz
Make assert_refcount skip the OBJECT REFCOUNT check with needs:debug tag (#11487)
This PR add `assert_refcount_morethan`, and modify `assert_refcount` to skip the `OBJECT REFCOUNT` check with `needs:debug` flag. Use them to modify all `OBJECT REFCOUNT` calls and also update the tests/README to be more specific. The reasoning is that some of these tests could be testing something important, and along the way also add a check for the refcount, and it could be a shame to skip the whole test just because the refcount functionality is missing or blocked. but much like the fact that some redis variants may not support DEBUG, and still we want to run the majority of the test for coverage, and just skip the digest match.
Diffstat (limited to 'tests/support')
-rw-r--r--tests/support/test.tcl13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/support/test.tcl b/tests/support/test.tcl
index 34b5aad29..2fe52f475 100644
--- a/tests/support/test.tcl
+++ b/tests/support/test.tcl
@@ -103,10 +103,23 @@ proc assert_type {type key} {
}
proc assert_refcount {ref key} {
+ if {[lsearch $::denytags "needs:debug"] >= 0} {
+ return
+ }
+
set val [r object refcount $key]
assert_equal $ref $val
}
+proc assert_refcount_morethan {key ref} {
+ if {[lsearch $::denytags "needs:debug"] >= 0} {
+ return
+ }
+
+ set val [r object refcount $key]
+ assert_morethan $val $ref
+}
+
# Wait for the specified condition to be true, with the specified number of
# max retries and delay between retries. Otherwise the 'elsescript' is
# executed.