Skip to content

Commit 4e6422c

Browse files
committed
tx-submission: improved logging for prop_accept_failure test failures
1 parent 9d32794 commit 4e6422c

File tree

1 file changed

+6
-3
lines changed
  • ouroboros-network/testlib/Test/Ouroboros/Network/Diffusion/Testnet

1 file changed

+6
-3
lines changed

ouroboros-network/testlib/Test/Ouroboros/Network/Diffusion/Testnet/Cardano.hs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@
1616

1717
module Test.Ouroboros.Network.Diffusion.Testnet.Cardano (tests) where
1818

19-
import Control.Exception (AssertionFailed (..), catch, evaluate, fromException)
19+
import Control.Exception (AssertionFailed (..), catch, displayException,
20+
evaluate, fromException)
2021
import Control.Monad.Class.MonadFork
2122
import Control.Monad.Class.MonadTest (exploreRaces)
2223
import Control.Monad.Class.MonadTime.SI (DiffTime, Time (Time), addTime,
@@ -2259,13 +2260,15 @@ prop_accept_failure (AbsIOError ioerr) =
22592260
counterexample (show evs)
22602261
. (if isFatalAccept ioerr
22612262
then -- verify that the node was killed by the right exception
2262-
any (\case
2263+
counterexample ("fatal exception " ++ displayException ioerr ++ " not propagated")
2264+
. any (\case
22632265
TrErrored e | Just e' <- fromException e
22642266
, e' == ioerr
22652267
-> True
22662268
_ -> False)
22672269
else -- verify that the node was not killed by the `ioerr` exception
2268-
all (\case
2270+
counterexample ("non-fatal exception " ++ displayException ioerr ++ " propagated")
2271+
. all (\case
22692272
TrErrored {} -> False
22702273
_ -> True)
22712274
)

0 commit comments

Comments
 (0)