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
dec6fd3a
Commit
dec6fd3a
authored
May 14, 2020
by
antirez
Browse files
Regression test for #7249.
parent
3e6acc24
Changes
1
Hide whitespace changes
Inline
Side-by-side
tests/unit/tracking.tcl
View file @
dec6fd3a
...
@@ -107,5 +107,27 @@ start_server {tags {"tracking"}} {
...
@@ -107,5 +107,27 @@ start_server {tags {"tracking"}} {
assert
{
$keys
eq
{
mykey
}}
assert
{
$keys
eq
{
mykey
}}
}
}
test
{
Tracking gets notification on tracking table key eviction
}
{
r CLIENT TRACKING off
r CLIENT TRACKING on REDIRECT $redir NOLOOP
r MSET key1 1 key2 2
# Let the server track the two keys for us
r MGET key1 key2
# Force the eviction of all the keys but one:
r config set tracking-table-max-keys 1
# Note that we may have other keys in the table for this client,
# since we disabled/enabled tracking multiple time with the same
# ID, and tracking does not do ID cleanups for performance reasons.
# So we check that eventually we'll receive one or the other key,
# otherwise the test will die for timeout.
while 1
{
set keys
[
lindex
[
$rd1
read
]
2
]
if
{
$keys
eq
{
key1
}
|| $keys eq
{
key2
}}
break
}
# We should receive an expire notification for one of
# the two keys
(
only one must remain
)
assert
{
$keys
eq
{
key1
}
|| $keys eq
{
key2
}}
}
$rd1 close
$rd1 close
}
}
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