mirror of https://mirror.osredm.com/root/redis.git
Fix timing issue in lazyfree test (#13926)
This test was introduced by https://github.com/redis/redis/issues/13853 We determine if the client is in blocked status, but if async flushdb is completed before checking the blocked status, the test will fail. So modify the test to only determine if `lazyfree_pending_objects` is correct to ensure that flushdb is async, that is, the client must be blocked.
This commit is contained in:
parent
90fa80f372
commit
b33a405bf1
|
@ -176,11 +176,20 @@ start_server {tags {"lazyfree"}} {
|
|||
}
|
||||
|
||||
test "Unblocks client blocked on lazyfree via REPLICAOF command" {
|
||||
r config resetstat
|
||||
set rd [redis_deferring_client]
|
||||
|
||||
populate 50000 ;# Just to make flushdb async slower
|
||||
$rd flushdb
|
||||
wait_for_blocked_client
|
||||
|
||||
# Verify flushdb run as lazyfree
|
||||
wait_for_condition 50 100 {
|
||||
[s lazyfree_pending_objects] > 0 ||
|
||||
[s lazyfreed_objects] > 0
|
||||
} else {
|
||||
fail "FLUSHDB didn't run as lazyfree"
|
||||
}
|
||||
|
||||
# Test that slaveof command unblocks clients without assertion failure
|
||||
r slaveof 127.0.0.1 0
|
||||
assert_equal [$rd read] {OK}
|
||||
|
|
Loading…
Reference in New Issue