mirror of
https://github.com/fluencelabs/redis
synced 2025-03-31 14:51:04 +00:00
Fix race condition in unit/introspection
Make sure monitor is attached in one connection before issuing commands to be monitored in another one
This commit is contained in:
parent
bea1259190
commit
97a2248309
@ -6,16 +6,17 @@ start_server {tags {"introspection"}} {
|
|||||||
test {MONITOR can log executed commands} {
|
test {MONITOR can log executed commands} {
|
||||||
set rd [redis_deferring_client]
|
set rd [redis_deferring_client]
|
||||||
$rd monitor
|
$rd monitor
|
||||||
|
assert_match {*OK*} [$rd read]
|
||||||
r set foo bar
|
r set foo bar
|
||||||
r get foo
|
r get foo
|
||||||
list [$rd read] [$rd read] [$rd read]
|
list [$rd read] [$rd read]
|
||||||
} {*OK*"set" "foo"*"get" "foo"*}
|
} {*"set" "foo"*"get" "foo"*}
|
||||||
|
|
||||||
test {MONITOR can log commands issued by the scripting engine} {
|
test {MONITOR can log commands issued by the scripting engine} {
|
||||||
set rd [redis_deferring_client]
|
set rd [redis_deferring_client]
|
||||||
$rd monitor
|
$rd monitor
|
||||||
r eval {redis.call('set',KEYS[1],ARGV[1])} 1 foo bar
|
|
||||||
$rd read ;# Discard the OK
|
$rd read ;# Discard the OK
|
||||||
|
r eval {redis.call('set',KEYS[1],ARGV[1])} 1 foo bar
|
||||||
assert_match {*eval*} [$rd read]
|
assert_match {*eval*} [$rd read]
|
||||||
assert_match {*lua*"set"*"foo"*"bar"*} [$rd read]
|
assert_match {*lua*"set"*"foo"*"bar"*} [$rd read]
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user