Skip to content

Commit

Permalink
testsuite --dump-logs works on servers started before the test
Browse files Browse the repository at this point in the history
  • Loading branch information
oranagra committed Aug 28, 2024
1 parent 3c9f595 commit 26a0cf0
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions tests/support/test.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,7 @@ proc test {name code {okpattern undefined} {tags {}}} {

send_data_packet $::test_server_fd testing $name

set failed false
set test_start_time [clock milliseconds]
if {[catch {set retval [uplevel 1 $code]} error]} {
set assertion [string match "assertion:*" $error]
Expand All @@ -231,6 +232,7 @@ proc test {name code {okpattern undefined} {tags {}}} {
lappend ::tests_failed $details

incr ::num_failed
set failed true
send_data_packet $::test_server_fd err [join $details "\n"]

if {$::stop_on_failure} {
Expand All @@ -253,10 +255,17 @@ proc test {name code {okpattern undefined} {tags {}}} {
lappend ::tests_failed $details

incr ::num_failed
set failed true
send_data_packet $::test_server_fd err [join $details "\n"]
}
}

if {$::dump_logs && $failed} {
foreach srv $::servers {
dump_server_log $srv
}
}

if {$::traceleaks} {
set output [exec leaks redis-server]
if {![string match {*0 leaks*} $output]} {
Expand Down

0 comments on commit 26a0cf0

Please sign in to comment.