[PATCH] run-tests: resurrect the wifexited polyfill (backout 6ab5a1c9ea3c)

Augie Fackler raf at durin42.com
Mon May 18 16:05:02 CDT 2015


On Mon, May 18, 2015 at 03:52:43PM -0500, Matt Harbison wrote:
> # HG changeset patch
> # User Matt Harbison <matt_harbison at yahoo.com>
> # Date 1431977682 14400
> #      Mon May 18 15:34:42 2015 -0400
> # Node ID 5f3094cb594217c66faa0eff35f5af26f1c035f6
> # Parent  153b9c5235c2f3057f0faac1ce94df9ac02cd83f
> run-tests: resurrect the wifexited polyfill (backout 6ab5a1c9ea3c)
>
> Python 2.7.3 on Windows doesn't have os.WIFEXITED, and the test output looked
> like this before I interrupted it.
>
>     $ ./run-tests.py --local -j2 -t700
>     EEEEEEEEEEEEEEEEEEEEEE

On the upside, the tests ran really fast, right?

*ducks*

Fix is queued, windows is always a source of "enjoyment."

>
> diff --git a/tests/run-tests.py b/tests/run-tests.py
> --- a/tests/run-tests.py
> +++ b/tests/run-tests.py
> @@ -103,6 +103,9 @@
>
>      _strpath = _bytespath
>
> +# For Windows support
> +wifexited = getattr(os, "WIFEXITED", lambda x: False)
> +
>  def checkportisavailable(port):
>      """return true if a port seems free to bind on localhost"""
>      try:
> @@ -804,7 +807,7 @@
>              raise
>
>          ret = proc.wait()
> -        if os.WIFEXITED(ret):
> +        if wifexited(ret):
>              ret = os.WEXITSTATUS(ret)
>
>          if proc.timeout:
> @@ -905,7 +908,7 @@
>                        self._testtmp, 0, self._getenv())
>          stdout, stderr = proc.communicate()
>          ret = proc.wait()
> -        if os.WIFEXITED(ret):
> +        if wifexited(ret):
>              ret = os.WEXITSTATUS(ret)
>          if ret == 2:
>              print(stdout)
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel at selenic.com
> http://selenic.com/mailman/listinfo/mercurial-devel


More information about the Mercurial-devel mailing list