Skip to content

Commit

Permalink
Fix incorrect usage of process_is_paused in tests
Browse files Browse the repository at this point in the history
It was introduced wrong in valkey-io#442.

Signed-off-by: Binbin <[email protected]>
  • Loading branch information
enjoy-binbin committed Jul 14, 2024
1 parent 34649bd commit 14b356c
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 20 deletions.
10 changes: 3 additions & 7 deletions tests/unit/cluster/faildet.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ test "Killing two slave nodes" {

test "Cluster should be still up" {
for {set j 0} {$j < [llength $::servers]} {incr j} {
if {[process_is_paused $paused_pid5]} continue
if {[process_is_paused $paused_pid6]} continue
if {[process_is_paused [srv -$j pid]]} continue
wait_for_condition 1000 50 {
[CI $j cluster_state] eq "ok"
} else {
Expand All @@ -34,9 +33,7 @@ test "Killing one master node" {
# failover is possible, that would change the state back to ok.
test "Cluster should be down now" {
for {set j 0} {$j < [llength $::servers]} {incr j} {
if {[process_is_paused $paused_pid]} continue
if {[process_is_paused $paused_pid5]} continue
if {[process_is_paused $paused_pid6]} continue
if {[process_is_paused [srv -$j pid]]} continue
wait_for_condition 1000 50 {
[CI $j cluster_state] eq "ok"
} else {
Expand All @@ -51,8 +48,7 @@ test "Restarting master node" {

test "Cluster should be up again" {
for {set j 0} {$j < [llength $::servers]} {incr j} {
if {[process_is_paused $paused_pid5]} continue
if {[process_is_paused $paused_pid6]} continue
if {[process_is_paused [srv -$j pid]]} continue
wait_for_condition 1000 50 {
[CI $j cluster_state] eq "ok"
} else {
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/cluster/failover.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ test "Wait for failover" {

test "Cluster should eventually be up again" {
for {set j 0} {$j < [llength $::servers]} {incr j} {
if {[process_is_paused $paused_pid]} continue
if {[process_is_paused [srv -$j pid]]} continue
wait_for_condition 1000 50 {
[CI $j cluster_state] eq "ok"
} else {
Expand Down
8 changes: 2 additions & 6 deletions tests/unit/cluster/manual-takeover.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,7 @@ foreach id $replica_ids {

test "Cluster should eventually be down" {
for {set j 0} {$j < [llength $::servers]} {incr j} {
if {[process_is_paused $paused_pid]} continue
if {[process_is_paused $paused_pid1]} continue
if {[process_is_paused $paused_pid2]} continue
if {[process_is_paused [srv -$j pid]]} continue
wait_for_condition 1000 50 {
[CI $j cluster_state] eq "fail"
} else {
Expand All @@ -52,9 +50,7 @@ test "Use takeover to bring slaves back" {

test "Cluster should eventually be up again" {
for {set j 0} {$j < [llength $::servers]} {incr j} {
if {[process_is_paused $paused_pid]} continue
if {[process_is_paused $paused_pid1]} continue
if {[process_is_paused $paused_pid2]} continue
if {[process_is_paused [srv -$j pid]]} continue
wait_for_condition 1000 50 {
[CI $j cluster_state] eq "ok"
} else {
Expand Down
4 changes: 2 additions & 2 deletions tests/unit/cluster/slave-selection.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ test "Wait for the node #10 to return alive before ending the test" {

test "Cluster should eventually be up again" {
for {set j 0} {$j < [llength $::servers]} {incr j} {
if {[process_is_paused $paused_pid]} continue
if {[process_is_paused [srv -$j pid]]} continue
wait_for_condition 1000 50 {
[CI $j cluster_state] eq "ok"
} else {
Expand Down Expand Up @@ -190,7 +190,7 @@ test "New Master down consecutively" {
}

for {set j 0} {$j < [llength $::servers]} {incr j} {
if {[process_is_paused $paused_pid]} continue
if {[process_is_paused [srv -$j pid]]} continue
wait_for_condition 1000 50 {
[CI $j cluster_state] eq "ok"
} else {
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/cluster/slave-stop-cond.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ test "Slave #5 should not be able to failover" {

test "Cluster should be down" {
for {set j 0} {$j < [llength $::servers]} {incr j} {
if {[process_is_paused $paused_pid]} continue
if {[process_is_paused [srv -$j pid]]} continue
wait_for_condition 100 50 {
[CI $j cluster_state] eq "fail"
} else {
Expand Down
5 changes: 2 additions & 3 deletions tests/unit/cluster/update-msg.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ test "Wait for failover" {

test "Cluster should eventually be up again" {
for {set j 0} {$j < [llength $::servers]} {incr j} {
if {[process_is_paused $paused_pid]} continue
if {[process_is_paused [srv -$j pid]]} continue
wait_for_condition 1000 50 {
[CI $j cluster_state] eq "ok"
} else {
Expand All @@ -72,8 +72,7 @@ test "Killing the new master #5" {

test "Cluster should be down now" {
for {set j 0} {$j < [llength $::servers]} {incr j} {
if {[process_is_paused $paused_pid]} continue
if {[process_is_paused $paused_pid5]} continue
if {[process_is_paused [srv -$j pid]]} continue
wait_for_condition 1000 50 {
[CI $j cluster_state] eq "fail"
} else {
Expand Down

0 comments on commit 14b356c

Please sign in to comment.