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
58d61dd6
"include/raft.h" did not exist on "e95a1a87d8067743fa2bdd7c9201c872a7fff74f"
Commit
58d61dd6
authored
Apr 22, 2020
by
antirez
Browse files
Tracking: NOLOOP tests.
parent
2d1968f8
Changes
1
Hide whitespace changes
Inline
Side-by-side
tests/unit/tracking.tcl
View file @
58d61dd6
...
...
@@ -7,6 +7,9 @@ start_server {tags {"tracking"}} {
$rd1 subscribe __redis__:invalidate
$rd1 read
;
# Consume the SUBSCRIBE reply.
# Create another client as well in order to test NOLOOP
set rd2
[
redis_deferring_client
]
test
{
Clients are able to enable tracking and redirect it
}
{
r CLIENT TRACKING on REDIRECT $redir
}
{
*OK
}
...
...
@@ -62,5 +65,34 @@ start_server {tags {"tracking"}} {
assert
{
$keys
eq
{
c:1234
}}
}
test
{
Tracking NOLOOP mode in standard mode works
}
{
r CLIENT TRACKING off
r CLIENT TRACKING on REDIRECT $redir NOLOOP
r MGET otherkey1 loopkey otherkey2
$rd2 SET otherkey1 1
;
# We should get this
r SET loopkey 1
;
# We should not get this
$rd2 SET otherkey2 1
;
# We should get this
# Because of the internals, we know we are going to receive
# two separated notifications for the two different prefixes.
set keys1
[
lsort
[
lindex
[
$rd1
read
]
2
]]
set keys2
[
lsort
[
lindex
[
$rd1
read
]
2
]]
set keys
[
lsort
[
list
{*}
$keys1
{*}
$keys2
]]
assert
{
$keys
eq
{
otherkey1 otherkey2
}}
}
test
{
Tracking NOLOOP mode in BCAST mode works
}
{
r CLIENT TRACKING off
r CLIENT TRACKING on BCAST REDIRECT $redir NOLOOP
$rd2 SET otherkey1 1
;
# We should get this
r SET loopkey 1
;
# We should not get this
$rd2 SET otherkey2 1
;
# We should get this
# Because of the internals, we know we are going to receive
# two separated notifications for the two different prefixes.
set keys1
[
lsort
[
lindex
[
$rd1
read
]
2
]]
set keys2
[
lsort
[
lindex
[
$rd1
read
]
2
]]
set keys
[
lsort
[
list
{*}
$keys1
{*}
$keys2
]]
assert
{
$keys
eq
{
otherkey1 otherkey2
}}
}
$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