@@ -9,7 +9,7 @@ import Control.Exception (Exception, try)
99import Control.Monad.Catch (throwM, MonadThrow)
1010import Control.Monad.Error.Class (throwError, MonadError)
1111import Control.Monad.Trans.Except (runExceptT, ExceptT)
12−import Data.Foldable (forM_)
12+import Data.Foldable (forM_, fold)
1313import Data.List (sort)
1414import Test.Hspec
1515
@@ -334,6 +334,11 @@ main = hspec $ do
334334 describe "Composed MonadThrow asCoparAhead" $ composeWithMonadThrow asCoparAhead
335335 describe "Composed MonadThrow asParallel" $ composeWithMonadThrow asParallel
336336
337+ it "Crosses thread limit (2000 threads)" $
338+ runStream (asParAhead $ fold $
339+ replicate 2000 $ A.once $ threadDelay 1000000)
340+ `shouldReturn` ()
341+
337342-- XXX need to test that we have promptly cleaned up everything after the error
338343-- XXX We can also check the output that we are expected to get before the
339344-- error occurs.