• Tamar Christina's avatar
    Fix various issues with testsuite code on Windows · a3704409
    Tamar Christina authored
    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:
    I...
    a3704409
timeout.hs 5.66 KB