<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=utf-8"><meta name=Generator content="Microsoft Word 15 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:#954F72;
        text-decoration:underline;}
.MsoChpDefault
        {mso-style-type:export-only;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style></head><body lang=EN-US link=blue vlink="#954F72"><div class=WordSection1><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Thanks!</p><p class=MsoNormal>Had missed the spawning of a new process part.</p><p class=MsoNormal><o:p> </o:p></p><div style='mso-element:para-border-div;border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in'><p class=MsoNormal style='border:none;padding:0in'><b>From: </b><a href="mailto:ben@smart-cactus.org">Ben Gamari</a><br><b>Sent: </b>Saturday, October 15, 2016 00:12<br><b>To: </b><a href="mailto:lonetiger@gmail.com">lonetiger@gmail.com</a>; <a href="mailto:ghc-devs@haskell.org">ghc-devs@haskell.org</a><br><b>Subject: </b>Re: Testsuite threadsafety</p></div><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>lonetiger@gmail.com writes:</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>> Hi *,</p><p class=MsoNormal>><o:p> </o:p></p><p class=MsoNormal>> I’m trying to understand  a few pieces of code in the testsuite,</p><p class=MsoNormal>><o:p> </o:p></p><p class=MsoNormal>> As it so happens quite a few tests randomly fail on newer msys2 and python installs:</p><p class=MsoNormal>><o:p> </o:p></p><p class=MsoNormal>>    r:/temp/ghctest-0u4c8o/test   spaces/./th/T12407.run                                    T12407 [ext-interp] ([Error 183] Cannot create a file when that file already exists: 'r:/temp/ghctest-0u4c8o/test   spaces/./th/T12407.run')</p><p class=MsoNormal>>    r:/temp/ghctest-0u4c8o/test   spaces/./th/T11463.run                                    T11463 [ext-interp] ([Error 183] Cannot create a file when that file already exists: 'r:/temp/ghctest-0u4c8o/test   spaces/./th/T11463.run')</p><p class=MsoNormal>>    r:/temp/ghctest-0u4c8o/test   spaces/./th/T12478_4.run                                  T12478_4 [ext-interp] ([Error 183] Cannot create a file when that file already exists: 'r:/temp/ghctest-0u4c8o/test   spaces/./th/T12478_4.run')</p><p class=MsoNormal>>    r:/temp/ghctest-0u4c8o/test   spaces/./th/T12478_3.run                                  T12478_3 [ext-interp] ([Error 183] Cannot create a file when that file already exists: 'r:/temp/ghctest-0u4c8o/test   spaces/./th/T12478_3.run')</p><p class=MsoNormal>><o:p> </o:p></p><p class=MsoNormal>> (I say random, but the set of tests seem to be the same ones, just within that group a few randomly pass every so often. It’s mostly TH tests.)</p><p class=MsoNormal>><o:p> </o:p></p><p class=MsoNormal>> Anyone have any ideas? I’m not very familiar with the internals of the testsuite.</p><p class=MsoNormal>><o:p> </o:p></p><p class=MsoNormal>> Secondly, I’ve noticed all paths in the testsuite are relative paths. And this hand me wondering, relative to what. </p><p class=MsoNormal>><o:p> </o:p></p><p class=MsoNormal>> I see that in do_test we actually change directories</p><p class=MsoNormal>><o:p> </o:p></p><p class=MsoNormal>> 837     if opts.pre_cmd: </p><p class=MsoNormal>> 838         exit_code = runCmd('cd "{0}" && {1}'.format(opts.testdir, opts.pre_cmd))</p><p class=MsoNormal>><o:p> </o:p></p><p class=MsoNormal>If I understand this correctly, this is merely spawning off a child</p><p class=MsoNormal>shell process which then moves its own cwd to opts.testdir. This should</p><p class=MsoNormal>not affect the cwd of the testsuite driver, which means that it should</p><p class=MsoNormal>be perfectly safe.</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Cheers,</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>- Ben</p><p class=MsoNormal><o:p> </o:p></p></div></body></html>