quilt-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Quilt-dev] Race in test suite (faildiff.test)


From: Martin Quinson
Subject: Re: [Quilt-dev] Race in test suite (faildiff.test)
Date: Fri, 26 Jan 2018 04:22:09 +0100
User-agent: Mutt/1.9.1 (2017-09-22)

Hello,

On Thu, Jan 25, 2018 at 11:11:18PM +0100, Jean Delvare wrote:
> > Try appending a "2>&1" to direct all output to a single file.
> 
> Something like:
> 
> --- a/test/faildiff.test
> +++ b/test/faildiff.test
> @@ -27,7 +27,7 @@ What happens on binary files?
>       > File test.bin added to patch %{P}test.diff
>  
>       $ printf "\\003\\000\\001" > test.bin
> -     $ quilt diff -pab --no-index
> +     $ quilt diff -pab --no-index 2>&1
>       >~ (Files|Binary files) a/test\.bin and b/test\.bin differ
>       > Diff failed on file 'test.bin', aborting
>       $ echo %{?}
> 
> I tried that already, but it doesn't help. Which doesn't really
> surprise me: while the code in test/run is a bit beyond my own perl-fu,
> I seem to understand that the script itself is treating stdin and stdout
> all the same, so it would make no difference if we merge them in the
> test case itself.
> 
> That, on the other hand, works around the problem:
> 
> --- a/test/faildiff.test
> +++ b/test/faildiff.test
> @@ -27,8 +27,9 @@ What happens on binary files?
>       > File test.bin added to patch %{P}test.diff
>  
>       $ printf "\\003\\000\\001" > test.bin
> -     $ quilt diff -pab --no-index
> +     $ quilt diff -pab --no-index 2>/dev/null
>       >~ (Files|Binary files) a/test\.bin and b/test\.bin differ
> +     $ quilt diff -pab --no-index 1>/dev/null
>       > Diff failed on file 'test.bin', aborting
>       $ echo %{?}
>       > 1
> 
> But isn't it more of a hack than an actual fix? Aren't stdout and
> stderr supposed to be line-buffered? And when pointing to the same file
> or tty, shouldn't the messages reach said file or tty in the same order
> as printed in the code?

Well, I would say that stdout is line-buffered as long as it's sent to
a tty, but if it gets onto a pipe it's not line-buffered anymore. But
I still don't get why 2>&1 does not helps here. I cannot fully
understand the details of the perl code either, but it seems to me
like there is too much pipes going on in the exec_test() function. 

For example, why are we duplicating STDERR in the client code since
we're never using the copy? Also, with the following line getting
executed by the child process right after duplicating STDERR, I don't
see how pipe redirection at the shell level could have any impact. 

                open STDERR, ">&STDOUT"
                
But from your tests it does. This is puzzling.

Bye, Mt.

-- 
Let's call it an accidental feature.  -- Larry Wall

Attachment: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]