summaryrefslogtreecommitdiff
path: root/mysql-test/mysql-test-run.pl
diff options
context:
space:
mode:
authorBjorn Munch <Bjorn.Munch@sun.com>2009-01-21 10:34:01 +0100
committerBjorn Munch <Bjorn.Munch@sun.com>2009-01-21 10:34:01 +0100
commit089663f9a7effab6198213e48daaea725c6d4267 (patch)
tree98b80136eed7bb0c08cef16d99fe85af24671dbc /mysql-test/mysql-test-run.pl
parentbb42e1ab05f9ebe166524d7d8a25c55a69e65dfa (diff)
downloadmariadb-git-089663f9a7effab6198213e48daaea725c6d4267.tar.gz
Bug #40399 Please make mtr print stack trace after every failure
SIGABRT is sent to relevant processes after a timeout client/mysqltest.cc: Fixed signal handlers to mysqltest actually dumps core mysql-test/lib/My/CoreDump.pm: Added support for dbx mysql-test/lib/My/SafeProcess.pm: Added dump_core to force process to dump core mysql-test/lib/My/SafeProcess/safe_process.cc: Traps SIGABRT and sends this on to child mysql-test/mysql-test-run.pl: When test times out, force core dumps on mysqltest and servers
Diffstat (limited to 'mysql-test/mysql-test-run.pl')
-rwxr-xr-xmysql-test/mysql-test-run.pl36
1 files changed, 28 insertions, 8 deletions
diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl
index cdb1352e7f6..857dda62c0a 100755
--- a/mysql-test/mysql-test-run.pl
+++ b/mysql-test/mysql-test-run.pl
@@ -464,7 +464,11 @@ sub run_test_server ($$$) {
else {
mtr_report(" - saving '$worker_savedir/' to '$savedir/'");
rename($worker_savedir, $savedir);
-
+ # Move any core files from e.g. mysqltest
+ foreach my $coref (glob("core*"))
+ {
+ move($coref, $savedir);
+ }
if ($opt_max_save_core > 0) {
# Limit number of core files saved
find({ no_chdir => 1,
@@ -2381,7 +2385,7 @@ sub kill_leftovers ($) {
}
mtr_report(" - found old pid $pid in '$elem', killing it...");
- my $ret= kill(9, $pid);
+ my $ret= kill("KILL", $pid);
if ($ret == 0) {
mtr_report(" process did not exist!");
next;
@@ -3284,11 +3288,6 @@ sub run_testcase ($) {
$test_timeout_proc->kill();
# ----------------------------------------------------
- # It's not mysqltest that has exited, kill it
- # ----------------------------------------------------
- $test->kill();
-
- # ----------------------------------------------------
# Check if it was a server that died
# ----------------------------------------------------
if ( grep($proc eq $_, started(all_servers())) )
@@ -3297,10 +3296,30 @@ sub run_testcase ($) {
$tinfo->{comment}=
"Server $proc failed during test run";
+ # ----------------------------------------------------
+ # It's not mysqltest that has exited, kill it
+ # ----------------------------------------------------
+ $test->kill();
+
report_failure_and_restart($tinfo);
return 1;
}
+ # Try to dump core for mysqltest and all servers
+ foreach my $proc ($test, started(all_servers()))
+ {
+ mtr_print("Trying to dump core for $proc");
+ if ($proc->dump_core())
+ {
+ $proc->wait_one(20);
+ }
+ }
+
+ # ----------------------------------------------------
+ # It's not mysqltest that has exited, kill it
+ # ----------------------------------------------------
+ $test->kill();
+
# ----------------------------------------------------
# Check if testcase timer expired
# ----------------------------------------------------
@@ -3319,6 +3338,7 @@ sub run_testcase ($) {
}
$tinfo->{'timeout'}= testcase_timeout(); # Mark as timeout
run_on_all($tinfo, 'analyze-timeout');
+
report_failure_and_restart($tinfo);
return 1;
}
@@ -4222,7 +4242,7 @@ sub start_servers($) {
}
else
{
- mysql_install_db($mysqld);
+ mysql_install_db($mysqld); # For versional testing
mtr_error("Failed to install system db to '$datadir'")
unless -d $datadir;