summaryrefslogtreecommitdiff
path: root/tests/instances.tcl
diff options
context:
space:
mode:
authorantirez <antirez@gmail.com>2016-01-15 10:19:28 +0100
committerantirez <antirez@gmail.com>2016-01-15 10:20:35 +0100
commit5432fc81dbe828aeb9af05549250ffc9557838a0 (patch)
treeb7f67e9a84efd6a89bf4dee25bf6233a4640deb4 /tests/instances.tcl
parentfc3ca8ff8714124901a438cd7277d9e4e1cdae46 (diff)
downloadredis-5432fc81dbe828aeb9af05549250ffc9557838a0.tar.gz
Detect and show crashes on Sentinel/Cluster tests.
Diffstat (limited to 'tests/instances.tcl')
-rw-r--r--tests/instances.tcl18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/instances.tcl b/tests/instances.tcl
index 766e820e9..b3c98a294 100644
--- a/tests/instances.tcl
+++ b/tests/instances.tcl
@@ -99,8 +99,25 @@ proc spawn_instance {type base_port count {conf {}}} {
}
}
+proc log_crashes {} {
+ set start_pattern {*REDIS BUG REPORT START*}
+ set logs [glob */log.txt]
+ foreach log $logs {
+ set fd [open $log]
+ set found 0
+ while {[gets $fd line] >= 0} {
+ if {[string match $start_pattern $line]} {
+ puts "\n*** Crash report found in $log ***"
+ set found 1
+ }
+ if {$found} {puts $line}
+ }
+ }
+}
+
proc cleanup {} {
puts "Cleaning up..."
+ log_crashes
foreach pid $::pids {
catch {exec kill -9 $pid}
}
@@ -110,6 +127,7 @@ proc cleanup {} {
}
proc abort_sentinel_test msg {
+ incr ::failed
puts "WARNING: Aborting the test."
puts ">>>>>>>> $msg"
if {$::pause_on_error} pause_on_error