[commit: ghc] master: Fix various issues with testsuite code on Windows (a370440)

git at git.haskell.org git at git.haskell.org
Wed Dec 28 10:34:26 UTC 2016


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/a3704409acc3bd237d3e872f640686918fb51f5f/ghc

>---------------------------------------------------------------

commit a3704409acc3bd237d3e872f640686918fb51f5f
Author: Tamar Christina <tamar at zhox.com>
Date:   Wed Dec 28 10:04:28 2016 +0000

    Fix various issues with testsuite code on Windows
    
    Summary:
    Previously we would make direct calls to `diff` using `os.system`.
    On Windows `os.system` is implemented using the standard
    idiom `CreateProcess .. WaitForSingleObject ..`.
    
    This again runs afoul with the `_exec` behaviour on Windows. So we ran
    into some trouble where sometimes `diff` would return before it's done.
    
    On tests which run multiple ways, such as `8086` what happens is that
    we think the diff is done and continue. The next way tries to set things
    up again by removing any previous directory. This would then fail with
    and error saying the directory can't be removed. Which is true, because
    the previous diff code/child is still running.
    
    We shouldn't make any external calls to anything using `os.system`.
    Instead just use `runCmd` which uses `timeout`. This also ensures that if
    we hit the cygwin bug where diff or any other utility hangs, we kill it and
    continue and not hang the entire test and leave hanging processes.
    
    Further more we also:
    Ignore error lines from `removeFile` from tools in the testsuite. This is a rather large
    hammer to work around the fact that `hsc2hs` often tries to remove it's own file too early.
    When this is patched the workaround can be removed. See Trac #9775
    
    We mark `prog003` as skip. Since this test randomly fails and passes. For stability it's disabled
    but it is a genuine bug which we should find. It's something with interface files being
    overwritten. See Trac #11317
    
    when `rmtree` hits a readonly file, the `onerror` handler is raised afterwards but not
    during the tree walk. It doesn't allow you to recover and continue as we thought.
    Instead you have to explicitly start again. This is why sometimes even though we
    call `cleanup` before `os.mkdirs`, it would sometimes fail with an error that the
    folder already exists. So we now do a second walk.
    
    A new verbosity level (4) will strip the silent flags from `MAKE` invocations so you can actually
    see what's going on.
    
    Test Plan: ./validate on build bots.
    
    Reviewers: bgamari, austin
    
    Reviewed By: bgamari
    
    Subscribers: mpickering, thomie, #ghc_windows_task_force
    
    Differential Revision: https://phabricator.haskell.org/D2894
    
    GHC Trac Issues: #12661, #11317, #9775


>---------------------------------------------------------------

a3704409acc3bd237d3e872f640686918fb51f5f
 testsuite/driver/testlib.py            | 110 ++++++++++++++++++++++-----------
 testsuite/tests/ghci/prog003/prog003.T |   6 +-
 testsuite/timeout/timeout.hs           |   4 +-
 3 files changed, 81 insertions(+), 39 deletions(-)

Diff suppressed because of size. To see it, use:

    git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc a3704409acc3bd237d3e872f640686918fb51f5f


More information about the ghc-commits mailing list