diff options
author | Oran Agra <oran@redislabs.com> | 2021-10-31 19:22:21 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-31 19:22:21 +0200 |
commit | 48d54265ce16cff0764b0aad7b56e091401b3d4b (patch) | |
tree | 46013178ddf7d8f33cf3312ca847ffce61912339 /tests/instances.tcl | |
parent | f26e90be0ccad273a8b7a71dfecaa4db43bfff29 (diff) | |
download | redis-48d54265ce16cff0764b0aad7b56e091401b3d4b.tar.gz |
Fix failing cluster tests (#9707)
Fix failures introduced by #9695 which was an attempt to solve failures introduced by #9679.
And alternative to #9703 (i didn't like the extra argument to kill_instance).
Reverting #9695.
Instead of stopping AOF on all terminations, stop it only on the two which need it.
Do it as part of the test rather than the infra (it was add that kill_instance used `R`
to communicate to the instance)
Note that the original purpose of these tests was to trigger a crash, but that upsets
valgrind so in redis 6.2 i changed it to use SIGTERM, so i now rename the tests
(remove "kill" and "crash").
Also add some colors to failures, and the word "FAILED" so that it's searchable.
And solve a semi-related race condition in 14-consistency-check.tcl
Diffstat (limited to 'tests/instances.tcl')
-rw-r--r-- | tests/instances.tcl | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/tests/instances.tcl b/tests/instances.tcl index 5f57b9ded..12c3ad974 100644 --- a/tests/instances.tcl +++ b/tests/instances.tcl @@ -204,10 +204,10 @@ proc stop_instance pid { incr wait 10 if {$wait == $max_wait} { - puts "Forcing process $pid to crash..." + puts [colorstr red "Forcing process $pid to crash..."] catch {exec kill -SEGV $pid} } elseif {$wait >= $max_wait * 2} { - puts "Forcing process $pid to exit..." + puts [colorstr red "Forcing process $pid to exit..."] catch {exec kill -KILL $pid} } elseif {$wait % 1000 == 0} { puts "Waiting for process $pid to exit..." @@ -376,10 +376,10 @@ proc test {descr code} { if {[catch {set retval [uplevel 1 $code]} error]} { incr ::failed if {[string match "assertion:*" $error]} { - set msg [string range $error 10 end] + set msg "FAILED: [string range $error 10 end]" puts [colorstr red $msg] if {$::pause_on_error} pause_on_error - puts "(Jumping to next unit after error)" + puts [colorstr red "(Jumping to next unit after error)"] return -code continue } else { # Re-raise, let handler up the stack take care of this. @@ -451,10 +451,10 @@ proc run_tests {} { # Print a message and exists with 0 / 1 according to zero or more failures. proc end_tests {} { if {$::failed == 0 } { - puts "GOOD! No errors." + puts [colorstr green "GOOD! No errors."] exit 0 } else { - puts "WARNING $::failed test(s) failed." + puts [colorstr red "WARNING $::failed test(s) failed."] exit 1 } } @@ -583,7 +583,7 @@ proc get_instance_id_by_port {type port} { fail "Instance $type port $port not found." } -# Kill an instance of the specified type/id with SIGTERM. +# Kill an instance of the specified type/id with SIGKILL. # This function will mark the instance PID as -1 to remember that this instance # is no longer running and will remove its PID from the list of pids that # we kill at cleanup. @@ -597,9 +597,6 @@ proc kill_instance {type id} { error "You tried to kill $type $id twice." } - # stop appendonly so that the instance won't refuse to go down - R $id config set appendonly no - stop_instance $pid set_instance_attrib $type $id pid -1 set_instance_attrib $type $id link you_tried_to_talk_with_killed_instance |