[GHC] #15363: Do some cleaning up of the testsuite driver

GHC ghc-devs at haskell.org
Sat Aug 25 20:40:07 UTC 2018


#15363: Do some cleaning up of the testsuite driver
-------------------------------------+-------------------------------------
        Reporter:  lantti            |                Owner:  lantti
            Type:  task              |               Status:  patch
        Priority:  low               |            Milestone:  8.8.1
       Component:  Test Suite        |              Version:  8.4.3
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------
Changes (by lantti):

 * status:  new => patch


Comment:

 I was playing around some more with the Windows process groups but
 eventually went the Job Objects way. The Windows console process groups
 are supported by subprocess module and os module, resulting in an almost
 total elimination of the diverging code path and working to my
 satisfaction on a light load, but unfortunately not working under mintty
 without additional winpty wrapping and still breaking apart on heavier
 loads due to Windows Console signals not being guaranteed to be delivered
 in such cases. The Job Objects on the other hand require a long diverging
 code path, but were absolutely robust against my limited stress tests. A
 preliminary patch is submitted to Phabricator:
 https://phabricator.haskell.org/D5107
 Some simple tests that I used to evaluate that:
 https://github.com/lantti/ghc/tree/testsuite-tests/testsuite/tests/aaa

 The patch follows the approach from timeout.hs for Windows and uses
 subprocess module for Posix. As the Windows code path doesn't use
 subprocess anymore the IO redirection and environment string generation
 are handled by this patch too. All in all the diverging code paths didn't
 get shorter, unlike I had hoped. According to my few test runs the
 testsuite runs slightly faster on Posix now, on Windows I don't have any
 coherent results of it running faster or slower. Also interrupting the
 test run on Windows is as sketchy as it used to be, it only works because
 mintty kills our process tree for us. No signals get delivered to our
 testsuite driver and none of our cleanup or results collecting code runs.

 Some related observations I made while working on this:
 - in addition to the signals/console incompatibility between mintty-mingw
 and native Windows programs, current versions of mintty-mingw have
 problems handling unicode environment variables, the variables get mangled
 already before they are passed to the python interpreter.

 - our Posix code (before and after the patch) leave child process
 management to the test process in cases of normal termination and keyboard
 interrupt, meaning that if the test program itself does not signal and
 wait for its children to terminate then nobody will. The only case where
 the testsuite driver takes action and signals the process group is after a
 timeout.

-- 
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/15363#comment:13>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list