You've already forked pgbackrest
mirror of
https://github.com/pgbackrest/pgbackrest.git
synced 2025-06-29 00:21:56 +02:00
Add new test for Common::Io::Process.
Show that output on stderr will raise an exception on close() even if the exit code is 0.
This commit is contained in:
@ -42,6 +42,19 @@ sub run
|
||||
$self->testResult(sub {defined($oIoProcess->processId())}, true, ' process id defined');
|
||||
}
|
||||
|
||||
################################################################################################################################
|
||||
if ($self->begin('close() and error when stderr has data'))
|
||||
{
|
||||
#---------------------------------------------------------------------------------------------------------------------------
|
||||
my $oIoProcess =
|
||||
new pgBackRest::Common::Io::Process(
|
||||
new pgBackRest::Common::Io::Buffered(
|
||||
new pgBackRest::Common::Io::Handle('test'), 1, 32), "echo '${strFileContent}' 1>&2");
|
||||
|
||||
$self->testException(
|
||||
sub {$oIoProcess->close()}, ERROR_FILE_READ, 'test terminated unexpectedly [000]: TESTDATA');
|
||||
}
|
||||
|
||||
################################################################################################################################
|
||||
if ($self->begin('close() & error()'))
|
||||
{
|
||||
|
Reference in New Issue
Block a user