summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorantirez <antirez@gmail.com>2019-05-14 16:54:59 +0200
committerantirez <antirez@gmail.com>2019-05-14 16:55:52 +0200
commit1a1ba483900005dab36e6749b112735593561f30 (patch)
treeea13d6a35ac309578f5c56b608cf60645784fa70
parent9724ca4e22678038c511d312a78df6e8d9d29374 (diff)
downloadredis-1a1ba483900005dab36e6749b112735593561f30.tar.gz
Test: fix slowlog test false positive.
In fast systems "SLOWLOG RESET" is fast enough to don't be logged even when the time limit is "1" sometimes. Leading to false positives such as: [err]: SLOWLOG - can be disabled in tests/unit/slowlog.tcl Expected '1' to be equal to '0'
-rw-r--r--tests/unit/slowlog.tcl4
1 files changed, 3 insertions, 1 deletions
diff --git a/tests/unit/slowlog.tcl b/tests/unit/slowlog.tcl
index dbd7a1547..22f088103 100644
--- a/tests/unit/slowlog.tcl
+++ b/tests/unit/slowlog.tcl
@@ -80,9 +80,11 @@ start_server {tags {"slowlog"} overrides {slowlog-log-slower-than 1000000}} {
}
test {SLOWLOG - can be disabled} {
+ r config set slowlog-max-len 1
r config set slowlog-log-slower-than 1
r slowlog reset
- assert_equal [r slowlog len] 1
+ r debug sleep 0.2
+ assert_equal [r slowlog len] 1
r config set slowlog-log-slower-than -1
r slowlog reset
r debug sleep 0.2