From e0717e2e56c05853024069216cc9c9004aa98a9d Mon Sep 17 00:00:00 2001 From: "msvensson@shellback.(none)" <> Date: Fri, 18 Jan 2008 22:30:38 +0100 Subject: [PATCH] Make "./mtr --start" exit if any child process dies --- mysql-test/mysql-test-run.pl | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index 8893a0343af..c12adf4f386 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -2312,9 +2312,16 @@ sub run_testcase ($) { # ---------------------------------------------------------------------- if ( $opt_start or $opt_start_dirty ) { - mtr_report("\nServers started, sleeping"); - sleep(1) while (1); - exit(0); + $suite_timeout_proc->kill(); + mtr_report("\nServers started, waiting for any of them to die..."); + my $proc= My::SafeProcess->wait_any(); + if ( grep($proc eq $_, started(all_servers())) ) + { + mtr_report("Server $proc died"); + exit(1); + } + mtr_report("Unknown process $proc died"); + exit(1); } my $test_timeout_proc= My::SafeProcess->timer($opt_testcase_timeout * 60);