PT-2295 - Fix tests on distributions

- t/pt-online-schema-change/pt-169.t failure on CentOS7 and potential
  failures on other platforms, because cleanup did not propagate
  original error code
This commit is contained in:
Sveta Smirnova
2024-02-06 21:04:30 +03:00
parent 9819736156
commit d07d6c00ff

View File

@@ -9352,6 +9352,7 @@ sub main {
# and the mentioned test error doesn't arise
my $original_error = $EVAL_ERROR;
my $original_error_code = $?;
foreach my $task ( reverse @cleanup_tasks ) {
eval {
@@ -9361,7 +9362,14 @@ sub main {
warn "Error cleaning up: $EVAL_ERROR\n";
}
}
die $original_error if $original_error; # rethrow original error
# rethrow original error
# we do not call _die here, because it prints messages to STDOUT
if ($original_error) {
print STDERR $original_error;
exit $original_error_code;
}
return;
}
);