summaryrefslogtreecommitdiff
path: root/tests/support
diff options
context:
space:
mode:
authorOran Agra <oran@redislabs.com>2021-12-19 17:41:51 +0200
committerGitHub <noreply@github.com>2021-12-19 17:41:51 +0200
commit6add1b7217458dab90b2458e4bac3fa9a2c15e1b (patch)
tree3d5c1656b78035bbe2fae44a121fb14611bbe34a /tests/support
parentae2f5b7b2e007e4bb7108407d7d41972312d0766 (diff)
downloadredis-6add1b7217458dab90b2458e4bac3fa9a2c15e1b.tar.gz
Add external test that runs without debug command (#9964)
- add needs:debug flag for some tests - disable "save" in external tests (speedup?) - use debug_digest proc instead of debug command directly so it can be skipped - use OBJECT ENCODING instead of DEBUG OBJECT to get encoding - add a proc for OBJECT REFCOUNT so it can be skipped - move a bunch of tests in latency_monitor tests to happen later so that latency monitor has some values in it - add missing close_replication_stream calls - make sure to close the temp client if DEBUG LOG fails
Diffstat (limited to 'tests/support')
-rw-r--r--tests/support/test.tcl13
-rw-r--r--tests/support/util.tcl12
2 files changed, 19 insertions, 6 deletions
diff --git a/tests/support/test.tcl b/tests/support/test.tcl
index 118300dbc..a4fec1564 100644
--- a/tests/support/test.tcl
+++ b/tests/support/test.tcl
@@ -88,14 +88,19 @@ proc assert_encoding {enc key} {
if {$::ignoreencoding} {
return
}
- set dbg [r debug object $key]
- assert_match "* encoding:$enc *" $dbg
+ set val [r object encoding $key]
+ assert_match $enc $val
}
proc assert_type {type key} {
assert_equal $type [r type $key]
}
+proc assert_refcount {ref key} {
+ set val [r object refcount $key]
+ assert_equal $ref $val
+}
+
# Wait for the specified condition to be true, with the specified number of
# max retries and delay between retries. Otherwise the 'elsescript' is
# executed.
@@ -159,7 +164,9 @@ proc test {name code {okpattern undefined} {tags {}}} {
if {$::external} {
catch {
set r [redis [srv 0 host] [srv 0 port] 0 $::tls]
- $r debug log "### Starting test $::cur_test"
+ catch {
+ $r debug log "### Starting test $::cur_test"
+ }
$r close
}
} else {
diff --git a/tests/support/util.tcl b/tests/support/util.tcl
index e4e420db7..d11841894 100644
--- a/tests/support/util.tcl
+++ b/tests/support/util.tcl
@@ -822,11 +822,17 @@ proc punsubscribe {client {channels {}}} {
}
proc debug_digest_value {key} {
- if {!$::ignoredigest} {
- r debug digest-value $key
- } else {
+ if {[lsearch $::denytags "needs:debug"] >= 0 || $::ignoredigest} {
return "dummy-digest-value"
}
+ r debug digest-value $key
+}
+
+proc debug_digest {{level 0}} {
+ if {[lsearch $::denytags "needs:debug"] >= 0 || $::ignoredigest} {
+ return "dummy-digest"
+ }
+ r $level debug digest
}
proc wait_for_blocked_client {} {