diff --git a/tests/unit/lazyfree.tcl b/tests/unit/lazyfree.tcl index b4650a500c..2e60355b8c 100644 --- a/tests/unit/lazyfree.tcl +++ b/tests/unit/lazyfree.tcl @@ -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}