Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
762eea07
"vscode:/vscode.git/clone" did not exist on "4cc8de1a371696ea16485d18c082b4c6481bf5b5"
Commit
762eea07
authored
Nov 12, 2011
by
antirez
Browse files
Added test to make sure Redis evicts expired keys actively (and not just in a lazy fashion).
parent
4be855e7
Changes
1
Hide whitespace changes
Inline
Side-by-side
tests/unit/expire.tcl
View file @
762eea07
...
@@ -127,4 +127,18 @@ start_server {tags {"expire"}} {
...
@@ -127,4 +127,18 @@ start_server {tags {"expire"}} {
set ttl
[
r pttl x
]
set ttl
[
r pttl x
]
assert
{
$ttl
> 900 && $ttl <= 1000
}
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
}
}
}
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