diff --git a/doc/xml/release.xml b/doc/xml/release.xml index cc1896d53..aad359fef 100644 --- a/doc/xml/release.xml +++ b/doc/xml/release.xml @@ -169,6 +169,10 @@

Changed log test order to ignore unimportant log errors while shutting down .

+ + +

Drain stderr during test process execution as well as termination to prevent lockups if there is a lot of output.

+
diff --git a/test/lib/pgBackRestTest/Common/ExecuteTest.pm b/test/lib/pgBackRestTest/Common/ExecuteTest.pm index c8e2c1366..be499e0f1 100644 --- a/test/lib/pgBackRestTest/Common/ExecuteTest.pm +++ b/test/lib/pgBackRestTest/Common/ExecuteTest.pm @@ -99,9 +99,13 @@ sub begin $self->{pId} = open3(undef, $self->{hOut}, $self->{hError}, $self->{strCommand}); - # Create select objects + # Create buffered read object $self->{oIo} = new pgBackRest::Common::Io::Buffered(new pgBackRest::Common::Io::Handle('exec test', $self->{hOut}), 0, 65536); + # Create buffered error object + $self->{oIoError} = new pgBackRest::Common::Io::Buffered( + new pgBackRest::Common::Io::Handle('exec test', $self->{hError}), 0, 65536); + # Record start time and set process timeout $self->{iProcessTimeout} = 540; $self->{lTimeLast} = time(); @@ -167,6 +171,12 @@ sub endRetry } } + # Drain the stderr stream + while (defined(my $strLine = $self->{oIoError}->readLine(true, false))) + { + $self->{strErrorLog} .= "${strLine}\n"; + } + if (!$bWait) { return; @@ -193,9 +203,7 @@ sub endRetry } # Drain the stderr stream - my $oIoError = new pgBackRest::Common::Io::Buffered(new pgBackRest::Common::Io::Handle('exec test', $self->{hError}), 0, 65536); - - while (defined(my $strLine = $oIoError->readLine(true, false))) + while (defined(my $strLine = $self->{oIoError}->readLine(true, false))) { $self->{strErrorLog} .= "${strLine}\n"; }