-
Notifications
You must be signed in to change notification settings - Fork 23
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug
We observe the following:
ghci> quickCheck $ discardAfter 1 $ runSimOrThrow $ True <$ (forever (threadDelay 10))
*** Failed! Exception: '<<evaluation error: <<timeout>>>>' (after 1 test):
To Reproduce
ghci> import Test.QuickCheck
ghci> import Control.Monad.IOSim
ghci> import Control.Monad.Class.MonadTimer
ghci> quickCheck $ discardAfter 1 $ runSimOrThrow $ True <$ (forever (threadDelay 10))
*** Failed! Exception: '<<evaluation error: <<timeout>>>>' (after 1 test):
Expected behaviour
ghci> quickCheck $ discardAfter 1 $ runSimOrThrow $ True <$ (forever (threadDelay 10))
*** Gave up! Passed only 0 tests; 1000 discarded tests.
Desktop (please complete the following information):
GHCversion: 9.12.2io-simversion: 1.8.0.1io-classesversion: 1.8.0.1
Additional context
I think what's going on here is that io-sim is catching all timeout exceptions even though these are thrown by QuickCheck in this case. Perhaps more care can be taken here to avoid overlapping with QuickCheck? QuickCheck might be able to use a different exception, but that feels like a crutch?
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working