From e1fe5e6ea62cda8cf819c6109bfa10751716a32e Mon Sep 17 00:00:00 2001 From: Mateusz Galazyn Date: Tue, 11 Jul 2023 16:24:56 +0200 Subject: [PATCH] Fix Shutdown test for new exit codes --- .../Cardano/Testnet/Test/Node/Shutdown.hs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Node/Shutdown.hs b/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Node/Shutdown.hs index 46c58872482..18edd080d08 100644 --- a/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Node/Shutdown.hs +++ b/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Node/Shutdown.hs @@ -39,7 +39,7 @@ import qualified Testnet.Property.Utils as H import Cardano.Testnet import Data.Either (isRight) -import GHC.IO.Exception (ExitCode (ExitSuccess, ExitFailure)) +import GHC.IO.Exception (ExitCode (ExitFailure, ExitSuccess)) import GHC.Stack (callStack) import System.Process (interruptProcessGroupOf) import Testnet.Defaults @@ -233,7 +233,9 @@ hprop_shutdownOnSigint = H.integrationRetryWorkspace 2 "shutdown-on-sigint" $ \t when (isRight mExitCodeRunning) $ do H.cat (nodeStdout node) H.cat (nodeStderr node) - mExitCodeRunning === Right (ExitFailure 1) + case mExitCodeRunning of + Right (ExitFailure _) -> H.success + other -> H.failMessage callStack $ "Unexpected exit status for the testnet process: " <> show other logs <- H.readFile (nodeStdout node) case mapMaybe parseMsg $ reverse $ lines logs of