Commit abd4974f authored by unknown's avatar unknown
Browse files

Improve error / process handling in the Perl script to run the test suite (patch supplied by Kent).


mysql-test/lib/mtr_process.pl:
  Handle errors in child processes separate from the parent process (patch supplied by Kent).
mysql-test/lib/mtr_report.pl:
  New function to handle errors in child processes separate from the parent process (patch supplied by Kent).
  Expected to avoid HUP signals.
parent a5903ed9
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -166,7 +166,7 @@ sub spawn_impl ($$$$$$$$) {
      {
        if ( ! open(STDOUT,$log_file_open_mode,$output) )
        {
          mtr_error("can't redirect STDOUT to \"$output\": $!");
          mtr_child_error("can't redirect STDOUT to \"$output\": $!");
        }
      }

@@ -176,14 +176,14 @@ sub spawn_impl ($$$$$$$$) {
        {
          if ( ! open(STDERR,">&STDOUT") )
          {
            mtr_error("can't dup STDOUT: $!");
            mtr_child_error("can't dup STDOUT: $!");
          }
        }
        else
        {
          if ( ! open(STDERR,$log_file_open_mode,$error) )
          {
            mtr_error("can't redirect STDERR to \"$error\": $!");
            mtr_child_error("can't redirect STDERR to \"$error\": $!");
          }
        }
      }
@@ -192,13 +192,13 @@ sub spawn_impl ($$$$$$$$) {
      {
        if ( ! open(STDIN,"<",$input) )
        {
          mtr_error("can't redirect STDIN to \"$input\": $!");
          mtr_child_error("can't redirect STDIN to \"$input\": $!");
        }
      }

      if ( ! exec($path,@$arg_list_t) )
      {
        mtr_error("failed to execute \"$path\": $!");
        mtr_child_error("failed to execute \"$path\": $!");
      }
    }
  }
+6 −0
Original line number Diff line number Diff line
@@ -19,6 +19,7 @@ sub mtr_print_header ();
sub mtr_report (@);
sub mtr_warning (@);
sub mtr_error (@);
sub mtr_child_error (@);
sub mtr_debug (@);


@@ -286,6 +287,11 @@ sub mtr_error (@) {
  mtr_exit(1);
}

sub mtr_child_error (@) {
  print STDERR "mysql-test-run: *** ERROR(child): ",join(" ", @_),"\n";
  exit(1);
}

sub mtr_debug (@) {
  if ( $::opt_script_debug )
  {