Skip to content

Commit

Permalink
Fix valgrind timing issue failure in replica-redirect test (valkey-io…
Browse files Browse the repository at this point in the history
…#917)

Wait for the replica to become online before starting the actual test.

Signed-off-by: Simon Baatz <gmbnomis@gmail.com>
Signed-off-by: Ping Xie <pingxie@google.com>
  • Loading branch information
PingXie committed Sep 14, 2024
1 parent 0435593 commit 831d478
Showing 1 changed file with 2 additions and 26 deletions.
28 changes: 2 additions & 26 deletions tests/integration/replica-redirect.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -9,32 +9,8 @@ start_server {tags {needs:repl external:skip}} {
set replica_port [srv 0 port]
set replica_pid [srv 0 pid]

set replica_host [srv 0 host]
set replica_port [srv 0 port]
set replica_pid [srv 0 pid]

test {write command inside MULTI is QUEUED, EXEC should be REDIRECT} {
set rr [valkey_client]
$rr client capa redirect
$rr multi
assert_equal "QUEUED" [$rr set foo bar]

# Change the current instance to be a replica
r replicaof $primary_host $primary_port
wait_replica_online $primary

assert_error "REDIRECT*" {$rr exec}
$rr close
}

test {write command inside MULTI is REDIRECT, EXEC should be EXECABORT} {
set rr [valkey_client]
$rr client capa redirect
$rr multi
assert_error "REDIRECT*" {$rr set foo bar}
assert_error "EXECABORT*" {$rr exec}
$rr close
}
r replicaof $primary_host $primary_port
wait_replica_online $primary

test {replica allow read command by default} {
r get foo
Expand Down

0 comments on commit 831d478

Please sign in to comment.