mirror of
https://github.com/fluencelabs/redis
synced 2025-03-17 16:10:50 +00:00
Added test to make sure Redis evicts expired keys actively (and not just in a lazy fashion).
This commit is contained in:
parent
4be855e757
commit
762eea07ca
@ -127,4 +127,18 @@ start_server {tags {"expire"}} {
|
||||
set ttl [r pttl x]
|
||||
assert {$ttl > 900 && $ttl <= 1000}
|
||||
}
|
||||
|
||||
test {Redis should actively expire keys incrementally} {
|
||||
r flushdb
|
||||
r psetex key1 500 a
|
||||
r psetex key2 500 a
|
||||
r psetex key3 500 a
|
||||
set size1 [r dbsize]
|
||||
# Redis expires random keys ten times every second so we are
|
||||
# fairly sure that all the three keys should be evicted after
|
||||
# one second.
|
||||
after 1000
|
||||
set size2 [r dbsize]
|
||||
list $size1 $size2
|
||||
} {3 0}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user