mirror of
https://github.com/percona/percona-toolkit.git
synced 2025-10-20 09:40:38 +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";
|
or die "Cannot open file $file: $OS_ERROR";
|
||||||
*STDOUT->autoflush(1);
|
*STDOUT->autoflush(1);
|
||||||
|
|
||||||
open *STDERR, '>', $file
|
my (undef, $file2) = tempfile();
|
||||||
or die "Cannot open file $file: $OS_ERROR";
|
open *STDERR, '>', $file2
|
||||||
|
or die "Cannot open file $file2: $OS_ERROR";
|
||||||
*STDERR->autoflush(1);
|
*STDERR->autoflush(1);
|
||||||
|
|
||||||
my $status;
|
my $status;
|
||||||
@@ -762,7 +763,10 @@ sub full_output {
|
|||||||
exit $code->();
|
exit $code->();
|
||||||
}
|
}
|
||||||
close $_ or die "Cannot close $_: $OS_ERROR" for qw(STDOUT STDERR);
|
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);
|
return ($output, $status);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user