Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
1b13adf3
Commit
1b13adf3
authored
Mar 28, 2013
by
antirez
Browse files
Test: verify that lazy-expire works.
parent
32a83c82
Changes
1
Hide whitespace changes
Inline
Side-by-side
tests/unit/expire.tcl
View file @
1b13adf3
...
@@ -160,6 +160,24 @@ start_server {tags {"expire"}} {
...
@@ -160,6 +160,24 @@ start_server {tags {"expire"}} {
list $size1 $size2
list $size1 $size2
}
{
3 0
}
}
{
3 0
}
test
{
Redis should lazy expire keys
}
{
r flushdb
r debug set-active-expire 0
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
]
r mget key1 key2 key3
set size3
[
r dbsize
]
r debug set-active-expire 1
list $size1 $size2 $size3
}
{
3 3 0
}
test
{
5 keys in, 5 keys out
}
{
test
{
5 keys in, 5 keys out
}
{
r flushdb
r flushdb
r set a c
r set a c
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment