Skip to content

Commit

Permalink
replace retry logic with wait condition
Browse files Browse the repository at this point in the history
Signed-off-by: Ran Shidlansik <[email protected]>
  • Loading branch information
ranshid committed Jan 28, 2025
1 parent 0aec189 commit 73ab499
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions tests/unit/tracking.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -244,22 +244,22 @@ start_server {tags {"tracking network logreqres:skip"}} {
$rd_redirection QUIT
assert_equal OK [$rd_redirection read]
$rd_sg SET key1 2
set MAX_TRIES 100
set res -1
for {set i 0} {$i <= $MAX_TRIES && $res < 0} {incr i} {
set res [lsearch -exact [r PING] "tracking-redir-broken"]
}

# Reinstantiating after QUIT
set rd_redirection [valkey_deferring_client]
$rd_redirection CLIENT ID
set redir_id [$rd_redirection read]
$rd_redirection SUBSCRIBE __redis__:invalidate
$rd_redirection read ; # Consume the SUBSCRIBE reply

assert {$res >= 0}
# Consume PING reply
# Wait to read the tracking-redir-broken
wait_for_condition 1000 50 {
[lsearch -exact [r PING] "tracking-redir-broken"]
} else {
fail "Failed to get redirect broken indication"
}
# Consume PING reply
assert_equal PONG [r read]

}

test {Different clients can redirect to the same connection} {
Expand Down

0 comments on commit 73ab499

Please sign in to comment.