pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/devel/py-mercurial py-mercurial: add upstream patch to...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/3887bb1d2edb
branches:  trunk
changeset: 374094:3887bb1d2edb
user:      wiz <wiz%pkgsrc.org@localhost>
date:      Tue Jan 16 09:24:56 2018 +0000

description:
py-mercurial: add upstream patch to fix test failure

No change to binary package, so no PKGREVISION bump.

diffstat:

 devel/py-mercurial/Makefile                         |   4 +-
 devel/py-mercurial/distinfo                         |   3 +-
 devel/py-mercurial/patches/patch-tests_run-tests.py |  86 +++++++++++++++++++++
 3 files changed, 89 insertions(+), 4 deletions(-)

diffs (122 lines):

diff -r 4ad0f354e0fe -r 3887bb1d2edb devel/py-mercurial/Makefile
--- a/devel/py-mercurial/Makefile       Tue Jan 16 09:15:28 2018 +0000
+++ b/devel/py-mercurial/Makefile       Tue Jan 16 09:24:56 2018 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.20 2018/01/10 19:32:13 wiz Exp $
+# $NetBSD: Makefile,v 1.21 2018/01/16 09:24:56 wiz Exp $
 
 DISTNAME=      mercurial-${VERSION}
 PKGNAME=       ${PYPKGPREFIX}-${DISTNAME}
@@ -24,8 +24,6 @@
 .include "Makefile.version"
 
 # Known test failures:
-# test-run-tests.t:
-# https://bz.mercurial-scm.org/show_bug.cgi?id=5735
 # test-status-color.t:
 # https://bz.mercurial-scm.org/show_bug.cgi?id=5698
 do-test:
diff -r 4ad0f354e0fe -r 3887bb1d2edb devel/py-mercurial/distinfo
--- a/devel/py-mercurial/distinfo       Tue Jan 16 09:15:28 2018 +0000
+++ b/devel/py-mercurial/distinfo       Tue Jan 16 09:24:56 2018 +0000
@@ -1,8 +1,9 @@
-$NetBSD: distinfo,v 1.57 2018/01/10 19:32:13 wiz Exp $
+$NetBSD: distinfo,v 1.58 2018/01/16 09:24:56 wiz Exp $
 
 SHA1 (mercurial-4.4.2.tar.gz) = df543ee5bfef9ac224e2b3c108d3d2df234b043f
 RMD160 (mercurial-4.4.2.tar.gz) = 34c671ff1f2034c548c65a293fa563013a79482e
 SHA512 (mercurial-4.4.2.tar.gz) = 3d1d103689eac4f50cc1005be44144b37d75ebfac3ff3b4fc90d6f41fbee46e107a168d04f2c366ce7cca2733ea4e5b5127df462af8e253f61a72f8938833993
 Size (mercurial-4.4.2.tar.gz) = 5647013 bytes
 SHA1 (patch-tests_list-tree.py) = be9749aa09490efa28cb7cc9231fa3acf85afc7d
+SHA1 (patch-tests_run-tests.py) = 1cc2d09a5493467e12aa1c753f331a7fe9d04a64
 SHA1 (patch-tests_test-largefiles-misc.t) = f05ab87c76b51fe2a784a86d872d8e19bde30193
diff -r 4ad0f354e0fe -r 3887bb1d2edb devel/py-mercurial/patches/patch-tests_run-tests.py
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/devel/py-mercurial/patches/patch-tests_run-tests.py       Tue Jan 16 09:24:56 2018 +0000
@@ -0,0 +1,86 @@
+$NetBSD: patch-tests_run-tests.py,v 1.1 2018/01/16 09:24:56 wiz Exp $
+
+# HG changeset patch
+# User Jun Wu <quark%fb.com@localhost>
+# Date 1515456471 28800
+# Node ID 87676e8ee05692bda0144e29b0478f2cc339aa4d
+# Parent  f948c5b3f5c98815befc91b48aaf88e114c0b8aa
+test-run-tests: stabilize the test (issue5735)
+
+Previously there is a race condition because things happen in this order:
+
+  1. Check shouldStop
+  2. If shouldStop is false, print the diff
+  3. Call fail() -> set shouldStop
+
+The check and set should really happen in a same critical section.
+
+This patch adds a lock to address the issue.
+
+Test Plan:
+Run `run-tests.py -l test-run-tests.t` 20 times on gcc112 and the race
+condition does not reproduce.
+
+Differential Revision: https://phab.mercurial-scm.org/D1830
+
+--- tests/run-tests.py.orig    2017-12-01 19:49:45.000000000 +0000
++++ tests/run-tests.py
+@@ -659,6 +659,7 @@ class Test(unittest.TestCase):
+ 
+     def __init__(self, path, outputdir, tmpdir, keeptmpdir=False,
+                  debug=False,
++                 first=False,
+                  timeout=None,
+                  startport=None, extraconfigopts=None,
+                  py3kwarnings=False, shell=None, hgcommand=None,
+@@ -711,6 +712,7 @@ class Test(unittest.TestCase):
+         self._threadtmp = tmpdir
+         self._keeptmpdir = keeptmpdir
+         self._debug = debug
++        self._first = first
+         self._timeout = timeout
+         self._slowtimeout = slowtimeout
+         self._startport = startport
+@@ -896,9 +898,13 @@ class Test(unittest.TestCase):
+                 f.close()
+ 
+             # The result object handles diff calculation for us.
+-            if self._result.addOutputMismatch(self, ret, out, self._refout):
+-                # change was accepted, skip failing
+-                return
++            with firstlock:
++                if self._result.addOutputMismatch(self, ret, out, self._refout):
++                    # change was accepted, skip failing
++                    return
++                if self._first:
++                    global firsterror
++                    firsterror = True
+ 
+             if ret:
+                 msg = 'output changed and ' + describe(ret)
+@@ -1620,6 +1626,8 @@ class TTest(Test):
+         return TTest.ESCAPESUB(TTest._escapef, s)
+ 
+ iolock = threading.RLock()
++firstlock = threading.RLock()
++firsterror = False
+ 
+ class TestResult(unittest._TextTestResult):
+     """Holds results when executing via unittest."""
+@@ -1705,7 +1713,7 @@ class TestResult(unittest._TextTestResul
+ 
+     def addOutputMismatch(self, test, ret, got, expected):
+         """Record a mismatch in test output for a particular test."""
+-        if self.shouldStop:
++        if self.shouldStop or firsterror:
+             # don't print, some other test case already failed and
+             # printed, we're just stale and probably failed due to our
+             # temp dir getting cleaned up.
+@@ -2637,6 +2645,7 @@ class TestRunner(object):
+         t = testcls(refpath, self._outputdir, tmpdir,
+                     keeptmpdir=self.options.keep_tmpdir,
+                     debug=self.options.debug,
++                    first=self.options.first,
+                     timeout=self.options.timeout,
+                     startport=self._getport(count),
+                     extraconfigopts=self.options.extra_config_opt,



Home | Main Index | Thread Index | Old Index