stable ordering of test output

Augie Fackler raf at durin42.com
Sat Apr 15 13:04:50 EDT 2017


> On Apr 15, 2017, at 5:48 AM, Yuya Nishihara <yuya at tcha.org> wrote:
> 
> On Thu, 13 Apr 2017 16:17:34 -0400, Augie Fackler wrote:
>> # HG changeset patch
>> # User Augie Fackler <augie at google.com>
>> # Date 1492114180 14400
>> #      Thu Apr 13 16:09:40 2017 -0400
>> # Node ID ec81fd7580f3e31aa92e8834ffbcf2a8e80e72e3
>> # Parent  35afb54dbb4df2975dbbf0e1525b98611f18ba85
>> sshpeer: try harder to snag stderr when stdout closes unexpectedly
>> 
>> Resolves test failures on FreeBSD, but I'm not happy about the fix.
>> 
>> diff --git a/mercurial/sshpeer.py b/mercurial/sshpeer.py
>> --- a/mercurial/sshpeer.py
>> +++ b/mercurial/sshpeer.py
>> @@ -110,9 +110,17 @@ class doublepipe(object):
>>             if mainready:
>>                 meth = getattr(self._main, methname)
>>                 if data is None:
>> -                    return meth()
>> +                    r = meth()
>>                 else:
>> -                    return meth(data)
>> +                    r = meth(data)
>> +                if not r and data != 0:
> 
> I'm not sure what this condition is intended for. It's always true for
> write() because r is None and data is a str.

This forwarder is also used for read(), where data is the number of bytes to be read. At least, I think that’s right, now I’m doubting myself.

> 
>> +                    # We've observed a condition that indicates the
>> +                    # stdout closed unexpectedly. Check stderr one
>> +                    # more time and snag anything that's there before
>> +                    # letting anyone know the main part of the pipe
>> +                    # closed prematurely.
>> +                    _forwardoutput(self._ui, self._side)
>> +                return r



More information about the Mercurial-devel mailing list