mirror of
https://github.com/percona/percona-toolkit.git
synced 2025-10-19 08:56:34 +00:00
PerconaTest::full_output: Use different files for STDERR and STDOUT to avoid overwriting data
This commit is contained in:
@@ -736,8 +736,9 @@ sub full_output {
|
||||
or die "Cannot open file $file: $OS_ERROR";
|
||||
*STDOUT->autoflush(1);
|
||||
|
||||
open *STDERR, '>', $file
|
||||
or die "Cannot open file $file: $OS_ERROR";
|
||||
my (undef, $file2) = tempfile();
|
||||
open *STDERR, '>', $file2
|
||||
or die "Cannot open file $file2: $OS_ERROR";
|
||||
*STDERR->autoflush(1);
|
||||
|
||||
my $status;
|
||||
@@ -762,8 +763,11 @@ sub full_output {
|
||||
exit $code->();
|
||||
}
|
||||
close $_ or die "Cannot close $_: $OS_ERROR" for qw(STDOUT STDERR);
|
||||
my $output = do { local $/; open my $fh, "<", $file or die $!; <$fh> };
|
||||
my $output = slurp_file($file) . slurp_file($file2);
|
||||
|
||||
1 while unlink $file;
|
||||
1 while unlink $file2;
|
||||
|
||||
return ($output, $status);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user