comparison tests/run-tests.py @ 40976:ef7119cd4965

py3: enable legacy stdio mode in exewrapper This drops the test failure count from 166 to 117. The failures were typically in the form of `hg serve -d` spawning but crashing immediately, leaving clients with "bad http status" lines, connection refusals, and so forth. The underlying message on the server side was either "OSError: [WinError 6] The handle is invalid" or "OSError: [WinError 1] Incorrect function". Additionally, no output was rendered if the pager was activated. Thanks to Yuya for diagnosing the problem. The failure count drops to 107 when PYTHONLEGACYWINDOWSSTDIO=1 is defined in the environment. These failures seem to revolve around the dummyssh server process, and dumbhttp.py. So I'll probably add that to the test runner. One small regression here (only in py3) is that if hg.exe is already built, a messagebox appears when building it again saying that python37.dll can't be loaded. Python3 isn't in PATH by default, and setup.py tries running bare `hg` first. But MSYS prepends '.' to PATH, so it runs the local hg, but can't find the library. It falls back to the python used to invoke setup.py, so ultimately it works. I'm not sure if it's better to strip '.' from PATH or just skip right to `sys.executable hg` on Windows. Also, something seems to be wrong with run-tests._usecorrectpython(). I accidentially left off the 'PYTHON="py -3"' when building (thus making py2 stuff), and yet managed to invoke run-tests.py with "py -3". (And that only had 67 failures.)
author Matt Harbison <matt_harbison@yahoo.com>
date Sun, 16 Dec 2018 17:42:45 -0500
parents 2465e0b27a0d
children 08f5482a6755
comparison
equal deleted inserted replaced
40975:2465e0b27a0d 40976:ef7119cd4965
2638 self._bindir = os.path.join(self._installdir, b"bin") 2638 self._bindir = os.path.join(self._installdir, b"bin")
2639 self._hgcommand = b'hg' 2639 self._hgcommand = b'hg'
2640 self._tmpbindir = self._bindir 2640 self._tmpbindir = self._bindir
2641 self._pythondir = os.path.join(self._installdir, b"lib", b"python") 2641 self._pythondir = os.path.join(self._installdir, b"lib", b"python")
2642 2642
2643 # Force the use of hg.exe instead of relying on MSYS to recognize hg is
2644 # a python script and feed it to python.exe. Legacy stdio is force
2645 # enabled by hg.exe, and this is a more realistic way to launch hg
2646 # anyway.
2643 if os.name == 'nt' and not self._hgcommand.endswith(b'.exe'): 2647 if os.name == 'nt' and not self._hgcommand.endswith(b'.exe'):
2644 self._hgcommand += b'.exe' 2648 self._hgcommand += b'.exe'
2645 2649
2646 # set CHGHG, then replace "hg" command by "chg" 2650 # set CHGHG, then replace "hg" command by "chg"
2647 chgbindir = self._bindir 2651 chgbindir = self._bindir