mirror of
https://github.com/pgbackrest/pgbackrest.git
synced 2025-06-02 22:57:34 +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 IO::Select;
|
||||||
use IPC::Open3;
|
use IPC::Open3;
|
||||||
use POSIX ':sys_wait_h';
|
use POSIX ':sys_wait_h';
|
||||||
|
use Symbol 'gensym';
|
||||||
|
|
||||||
use lib dirname($0) . '/../lib';
|
use lib dirname($0) . '/../lib';
|
||||||
use BackRest::Common::Ini;
|
use BackRest::Common::Ini;
|
||||||
@ -351,7 +352,14 @@ sub BackRestTestCommon_ExecuteBegin
|
|||||||
&log(DEBUG, "executing command: ${strCommand}");
|
&log(DEBUG, "executing command: ${strCommand}");
|
||||||
|
|
||||||
# Execute the command
|
# Execute the command
|
||||||
|
$hError = gensym;
|
||||||
|
|
||||||
$pId = open3(undef, $hOut, $hError, $strCommand);
|
$pId = open3(undef, $hOut, $hError, $strCommand);
|
||||||
|
|
||||||
|
if (!defined($hError))
|
||||||
|
{
|
||||||
|
confess 'STDERR handle is undefined';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
####################################################################################################################################
|
####################################################################################################################################
|
||||||
@ -576,6 +584,7 @@ sub BackRestTestCommon_ExecuteEnd
|
|||||||
if ($bSuppressError)
|
if ($bSuppressError)
|
||||||
{
|
{
|
||||||
&log(DEBUG, "suppressed error was ${iExitStatus}");
|
&log(DEBUG, "suppressed error was ${iExitStatus}");
|
||||||
|
$strErrorLog = '';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -586,6 +595,11 @@ sub BackRestTestCommon_ExecuteEnd
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($strErrorLog ne '')
|
||||||
|
{
|
||||||
|
confess &log(ERROR, "output found on STDERR:\n${strErrorLog}");
|
||||||
|
}
|
||||||
|
|
||||||
if ($bShowOutput)
|
if ($bShowOutput)
|
||||||
{
|
{
|
||||||
print "output:\n${strOutLog}\n";
|
print "output:\n${strOutLog}\n";
|
||||||
|
Loading…
x
Reference in New Issue
Block a user