mirror of
https://github.com/pgbackrest/pgbackrest.git
synced 2025-05-31 22:49:46 +02:00
Improved issue #135: Suppress PostgreSQL notices.
Regression tests now fail if there is any unexpected output on stderr.
This commit is contained in:
parent
bb6963cf3b
commit
8d01138f6d
@ -19,6 +19,7 @@ use File::Path qw(remove_tree);
|
||||
use IO::Select;
|
||||
use IPC::Open3;
|
||||
use POSIX ':sys_wait_h';
|
||||
use Symbol 'gensym';
|
||||
|
||||
use lib dirname($0) . '/../lib';
|
||||
use BackRest::Common::Ini;
|
||||
@ -351,7 +352,14 @@ sub BackRestTestCommon_ExecuteBegin
|
||||
&log(DEBUG, "executing command: ${strCommand}");
|
||||
|
||||
# Execute the command
|
||||
$hError = gensym;
|
||||
|
||||
$pId = open3(undef, $hOut, $hError, $strCommand);
|
||||
|
||||
if (!defined($hError))
|
||||
{
|
||||
confess 'STDERR handle is undefined';
|
||||
}
|
||||
}
|
||||
|
||||
####################################################################################################################################
|
||||
@ -576,6 +584,7 @@ sub BackRestTestCommon_ExecuteEnd
|
||||
if ($bSuppressError)
|
||||
{
|
||||
&log(DEBUG, "suppressed error was ${iExitStatus}");
|
||||
$strErrorLog = '';
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -586,6 +595,11 @@ sub BackRestTestCommon_ExecuteEnd
|
||||
}
|
||||
}
|
||||
|
||||
if ($strErrorLog ne '')
|
||||
{
|
||||
confess &log(ERROR, "output found on STDERR:\n${strErrorLog}");
|
||||
}
|
||||
|
||||
if ($bShowOutput)
|
||||
{
|
||||
print "output:\n${strOutLog}\n";
|
||||
|
Loading…
x
Reference in New Issue
Block a user