Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deflake tracking-redir-broken test #1628

Merged
merged 2 commits into from
Jan 28, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 11 additions & 8 deletions tests/unit/tracking.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -236,27 +236,30 @@ start_server {tags {"tracking network logreqres:skip"}} {
}

test {RESP3 Client gets tracking-redir-broken push message after cached key changed when rediretion client is terminated} {
# make sure r is working resp 3
r HELLO 3
r CLIENT TRACKING on REDIRECT $redir_id
$rd_sg SET key1 1
r GET key1
$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"]
}
assert {$res >= 0}
# Consume PING reply
assert_equal PONG [r read]
Comment on lines -250 to -252
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why this fail? Because the r is not in resp3?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suspect that it did somehow. maybe the 'r' is disconnected and reconnected at some point

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's give it a try.


# 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

# 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
Loading