# HG changeset patch # User Sergey Kandaurov # Date 1685366831 -14400 # Node ID 38f1fd9ca3e64a3fd56f20356013b799a41b53a0 # Parent 8b74936ff2ac7cd1e569c0b5b48dba14c052f55b Tests: unbreak reading new stderr data after eof. Tests don't expect to stop reading redirected stderr when end of file is reached, but rather to read new data being appended, similar to "tail -f". The behaviour is found changed in Ubuntu 23.04's Perl 5.36, which applies the upstream patch [1] expected for inclusion in the upcoming Perl 5.38. The fix is to clear the filehandle's error state to continue reading. [1] https://github.com/Perl/perl5/commit/80c1f1e45e8e Updated mail_error_log.t and stream_error_log.t for consistency. diff --git a/error_log.t b/error_log.t --- a/error_log.t +++ b/error_log.t @@ -183,7 +183,9 @@ sub lines { my ($t, $file, $pattern) = @_; if ($file eq 'stderr') { - return map { $_ =~ /\Q$pattern\E/ } (<$stderr>); + my $value = map { $_ =~ /\Q$pattern\E/ } (<$stderr>); + $stderr->clearerr(); + return $value; } my $path = $t->testdir() . '/' . $file; diff --git a/mail_error_log.t b/mail_error_log.t --- a/mail_error_log.t +++ b/mail_error_log.t @@ -144,7 +144,9 @@ sub lines { my ($t, $file, $pattern) = @_; if ($file eq 'stderr') { - return map { $_ =~ /\Q$pattern\E/ } (<$stderr>); + my $value = map { $_ =~ /\Q$pattern\E/ } (<$stderr>); + $stderr->clearerr(); + return $value; } my $path = $t->testdir() . '/' . $file; diff --git a/stream_error_log.t b/stream_error_log.t --- a/stream_error_log.t +++ b/stream_error_log.t @@ -150,7 +150,9 @@ sub lines { my ($t, $file, $pattern) = @_; if ($file eq 'stderr') { - return map { $_ =~ /\Q$pattern\E/ } (<$stderr>); + my $value = map { $_ =~ /\Q$pattern\E/ } (<$stderr>); + $stderr->clearerr(); + return $value; } my $path = $t->testdir() . '/' . $file;