summaryrefslogtreecommitdiff
path: root/devel
diff options
context:
space:
mode:
authorwiz <wiz@pkgsrc.org>2018-01-16 09:24:56 +0000
committerwiz <wiz@pkgsrc.org>2018-01-16 09:24:56 +0000
commit69116debcee7173c4e7638bc36ecc00683b8f0a5 (patch)
treec83898dd5d90f2315630c1f6f1534d5e538daad5 /devel
parent5937d781132eb209e6bd08b24e8ac9720fe95b4d (diff)
downloadpkgsrc-69116debcee7173c4e7638bc36ecc00683b8f0a5.tar.gz
py-mercurial: add upstream patch to fix test failure
No change to binary package, so no PKGREVISION bump.
Diffstat (limited to 'devel')
-rw-r--r--devel/py-mercurial/Makefile4
-rw-r--r--devel/py-mercurial/distinfo3
-rw-r--r--devel/py-mercurial/patches/patch-tests_run-tests.py86
3 files changed, 89 insertions, 4 deletions
diff --git a/devel/py-mercurial/Makefile b/devel/py-mercurial/Makefile
index 755cb6b2e1f..4a5d404d622 100644
--- a/devel/py-mercurial/Makefile
+++ b/devel/py-mercurial/Makefile
@@ -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 @@ INSTALLATION_DIRS+= share/doc/mercurial
.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 --git a/devel/py-mercurial/distinfo b/devel/py-mercurial/distinfo
index f80ead729ab..893ea565982 100644
--- a/devel/py-mercurial/distinfo
+++ b/devel/py-mercurial/distinfo
@@ -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 --git a/devel/py-mercurial/patches/patch-tests_run-tests.py b/devel/py-mercurial/patches/patch-tests_run-tests.py
new file mode 100644
index 00000000000..a7164fbe51e
--- /dev/null
+++ b/devel/py-mercurial/patches/patch-tests_run-tests.py
@@ -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>
+# 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,