Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix race in test case "CLUSTER SLOT-STATS cpu-usec for blocking comma…
…nds, unblocked on timeout" The command BLPOP blocks for 1 second. The procedure `wait_for_blocked_clients_count` waits for one second by default. If the first `wait_for_blocked_clients_count` finishes very fast, then the second `wait_for_blocked_clients_count` can time out before the BLPOP has been unblocked. ```TCL test "CLUSTER SLOT-STATS cpu-usec for blocking commands, unblocked on timeout." { # Blocking command with 1 second timeout. set rd [valkey_deferring_client] $rd BLPOP $key 1 # Confirm that the client is blocked, then unblocked after 1 second timeout. wait_for_blocked_clients_count 1 wait_for_blocked_clients_count 0 ``` As seen in the definition of `wait_for_blocked_clients_count`, the total time to wait is 1 second by default. ```TCL proc wait_for_blocked_clients_count {count {maxtries 100} {delay 10} {idx 0}} { wait_for_condition $maxtries $delay { [s $idx blocked_clients] == $count } else { fail "Timeout waiting for blocked clients" } } ``` Signed-off-by: Viktor Söderqvist <[email protected]>
- Loading branch information