Transient Windows test failures
Matt Harbison
mharbison72 at gmail.com
Tue Jun 20 02:20:29 UTC 2017
On Mon, 19 Jun 2017 11:30:28 -0400, Yuya Nishihara <yuya at tcha.org> wrote:
> On Sun, 18 Jun 2017 22:19:29 -0400, Augie Fackler wrote:
>>
>> > On Jun 16, 2017, at 22:02, Matt Harbison <mharbison72 at gmail.com>
>> wrote:
>> >
>> > On Fri, 16 Jun 2017 09:59:30 -0400, Augie Fackler <raf at durin42.com>
>> wrote:
>> >
>> >> On Fri, Jun 16, 2017 at 12:18:18AM -0400, Matt Harbison wrote:
>> >>> So apparently, this is a symptom of not having %SystemRoot% in the
>> >>> environment when calling CreateProcess().
>> >>>
>> >>> https://bugs.python.org/issue13524
>> >>>
>> https://jpassing.com/2009/12/28/the-hidden-danger-of-forgetting-to-specify-systemroot-in-a-custom-environment-block/
>> >>>
>> >>> I see that setup.py special cases this variable. I did a search
>> for 'env
>> >>> =', and it looks like hooks and pager start with empty
>> environments, so they
>> >>> must not inherit this. IDR if any recent changes were made that
>> start with
>> >>> an empty environment.
>> >>>
>> >>> The thing I can't get my mind around is the hit and miss nature of
>> the
>> >>> error, if this is really the problem.
>> >>
>> >> It sounds like it should be harmless to just always forward
>> >> %SystemRoot% - should we just do that?
>> >
>> > Seems reasonable, but run-tests._getenv() already does an
>> os.environ.copy(), so it should be there?
>> >
>> > It does seem like a good idea to do it for hooks and other things
>> executed, where the environment is built from scratch. The question is
>> where? There's util.popen[2-4](), plus some direct calls to
>> subprocess.Popen(), and an os.system(). I considered
>> util.shellenviron(), but there are far fewer calls to this than places
>> where processes are spawned.
>
> (+CC foozy since he has Windows)
>
> Is the problem only seen in tests? I don't think environment variables
> are
> cleared in hg side.
I've only ever seen it while running the tests on this one Win7 x64
system. But since it only started in the last few weeks and is rare, I'd
say not enough data at this point.
I didn't think hg cleared anything, and the get-with-headers.py example in
this thread pretty much skips hg code (it does import util.py).
I've got a second Windows machine setup (but it's much slower, and really
can't deal with much more than --jobs=2), and I added code to run-tests.py
and dispatch.py to complain if SystemRoot is not set. I haven't seen it
pop up in the last few days (~6-8 full runs).
More information about the Mercurial-devel
mailing list