@@ -9,7 +9,7 @@ import Control.Exception (Exception, try)
9import Control.Monad.Catch (throwM, MonadThrow)
9import Control.Monad.Catch (throwM, MonadThrow)
10import Control.Monad.Error.Class (throwError, MonadError)
10import Control.Monad.Error.Class (throwError, MonadError)
11import Control.Monad.Trans.Except (runExceptT, ExceptT)
11import Control.Monad.Trans.Except (runExceptT, ExceptT)
12−import Data.Foldable (forM_)
12+import Data.Foldable (forM_, fold)
13import Data.List (sort)
13import Data.List (sort)
14import Test.Hspec
14import Test.Hspec
@@ -334,6 +334,11 @@ main = hspec $ do
334 describe "Composed MonadThrow asCoparAhead" $ composeWithMonadThrow asCoparAhead
334 describe "Composed MonadThrow asCoparAhead" $ composeWithMonadThrow asCoparAhead
335 describe "Composed MonadThrow asParallel" $ composeWithMonadThrow asParallel
335 describe "Composed MonadThrow asParallel" $ composeWithMonadThrow asParallel
337+ it "Crosses thread limit (2000 threads)" $
338+ runStream (asParAhead $ fold $
339+ replicate 2000 $ A.once $ threadDelay 1000000)
337-- XXX need to test that we have promptly cleaned up everything after the error
342-- XXX need to test that we have promptly cleaned up everything after the error
338-- XXX We can also check the output that we are expected to get before the
343-- XXX We can also check the output that we are expected to get before the
339-- error occurs.
344-- error occurs.