Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC

Commits:

2 changed files:

Changes:

  • libraries/base/tests/IO/T17912.hs
    ... ... @@ -6,6 +6,7 @@ import Control.Exception
    6 6
     import System.IO
    
    7 7
     import System.Exit
    
    8 8
     import System.Process
    
    9
    +import GHC.Conc (threadStatus, ThreadStatus(..), BlockReason(..))
    
    9 10
     import GHC.IO.Handle.FD
    
    10 11
     
    
    11 12
     main = do
    
    ... ... @@ -22,7 +23,14 @@ main = do
    22 23
                     putMVar passed True
    
    23 24
                  else print e
    
    24 25
                  throwIO e
    
    25
    -      threadDelay 1000
    
    26
    +      let waitUntilBlocked = do
    
    27
    +            st <- threadStatus opener
    
    28
    +            case st of
    
    29
    +              ThreadBlocked BlockedOnForeignCall -> return ()
    
    30
    +              ThreadFinished -> return ()
    
    31
    +              ThreadDied     -> return ()
    
    32
    +              _              -> threadDelay 100 >> waitUntilBlocked
    
    33
    +      waitUntilBlocked
    
    26 34
           forkIO $ killThread opener
    
    27 35
           forkIO $ do
    
    28 36
             threadDelay (10^6)
    

  • libraries/base/tests/IO/all.T
    ... ... @@ -182,7 +182,7 @@ test('T17414',
    182 182
          compile_and_run, [''])
    
    183 183
     test('T17510', expect_broken(17510), compile_and_run, [''])
    
    184 184
     test('bytestringread001', extra_run_opts('test.data'), compile_and_run, [''])
    
    185
    -test('T17912', [only_ways(['threaded1']), when(opsys('mingw32'),expect_broken(1))], compile_and_run, [''])
    
    185
    +test('T17912', [only_ways(['threaded1']), when(opsys('mingw32'),expect_broken(17912))], compile_and_run, [''])
    
    186 186
     test('T18832', only_ways(['threaded1']), compile_and_run, [''])
    
    187 187
     
    
    188 188
     test('mkdirExists', [exit_code(1), when(opsys('mingw32'), ignore_stderr)], compile_and_run, [''])