stable ordering of test output
Yuya Nishihara
yuya at tcha.org
Thu Apr 20 11:27:42 UTC 2017
On Wed, 19 Apr 2017 15:22:42 -0400, Augie Fackler wrote:
> On Sat, Apr 15, 2017 at 1:04 PM, Augie Fackler <raf at durin42.com> wrote:
> >
> >> 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.
>
> Should I go ahead and mail this patch? Perhaps with some extra
> comments? Or do people object to this fix?
Seems fine, but can you update the patch to not always call _forwardoutput()
by write() ? Perhaps this hack can be moved to read() and readline().
More information about the Mercurial-devel
mailing list