summaryrefslogtreecommitdiff
path: root/tests/unit/latency-monitor.tcl
diff options
context:
space:
mode:
authorantirez <antirez@gmail.com>2017-11-24 18:33:31 +0100
committerantirez <antirez@gmail.com>2017-11-24 18:33:31 +0100
commitdc2df135b34344446b87600e1204b11e1fb8fff5 (patch)
tree787ee7e8bd72055a6a2f23703945599660e32315 /tests/unit/latency-monitor.tcl
parentc508cb67939ac7c3e8ee5d1bcad3e8b5ab773081 (diff)
downloadredis-dc2df135b34344446b87600e1204b11e1fb8fff5.tar.gz
Test: regression test for latency expire events logging bug.
Regression for #4452.
Diffstat (limited to 'tests/unit/latency-monitor.tcl')
-rw-r--r--tests/unit/latency-monitor.tcl14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/unit/latency-monitor.tcl b/tests/unit/latency-monitor.tcl
index b736cad98..69da13f06 100644
--- a/tests/unit/latency-monitor.tcl
+++ b/tests/unit/latency-monitor.tcl
@@ -47,4 +47,18 @@ start_server {tags {"latency-monitor"}} {
assert {[r latency reset] > 0}
assert {[r latency latest] eq {}}
}
+
+ test {LATENCY of expire events are correctly collected} {
+ r config set latency-monitor-threshold 20
+ r eval {
+ local i = 0
+ while (i < 1000000) do
+ redis.call('sadd','mybigkey',i)
+ i = i+1
+ end
+ } 0
+ r pexpire mybigkey 1
+ after 500
+ assert_match {*expire-cycle*} [r latency latest]
+ }
}