diff --git a/.github/workflows/haskell.yml b/.github/workflows/haskell.yml index 1718aa53ad4..2186eb7b6bb 100644 --- a/.github/workflows/haskell.yml +++ b/.github/workflows/haskell.yml @@ -141,6 +141,11 @@ jobs: run: | cabal test cardano-testnet cardano-node cardano-node-chairman cardano-submit-api + - name: Timings + run: | + cd cardano-testnet + stat -c "%y %n" * | grep '\(start\|stop\)' | sort + - name: Tar failed tests workspaces if: ${{ failure() }} env: diff --git a/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Cli/Babbage/LeadershipSchedule.hs b/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Cli/Babbage/LeadershipSchedule.hs index 6ddc247821d..ca1e2da4009 100644 --- a/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Cli/Babbage/LeadershipSchedule.hs +++ b/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Cli/Babbage/LeadershipSchedule.hs @@ -48,13 +48,15 @@ import Hedgehog (Property, (===)) import qualified Hedgehog as H import Hedgehog.Extras (threadDelay) import qualified Hedgehog.Extras.Stock.IO.Network.Sprocket as IO -import qualified Hedgehog.Extras.Test.Base as H -import qualified Hedgehog.Extras.Test.File as H +import qualified Hedgehog.Extras.Test as H -- | Execute me with: -- @DISABLE_RETRIES=1 cabal test cardano-testnet-test --test-options '-p "/leadership-schedule/"'@ hprop_leadershipSchedule :: Property hprop_leadershipSchedule = H.integrationRetryWorkspace 2 "babbage-leadership-schedule" $ \tempAbsBasePath' -> do + H.threadDelay 1000 + H.writeFile "hprop_leadershipSchedule.start" "hprop_leadershipSchedule" + H.note_ SYS.os conf@Conf { tempAbsPath=tempAbsPath@(TmpAbsolutePath work) } <- mkConf tempAbsBasePath' let tempBaseAbsPath = makeTmpBaseAbsPath tempAbsPath @@ -355,3 +357,4 @@ hprop_leadershipSchedule = H.integrationRetryWorkspace 2 "babbage-leadership-sch H.noteShow_ (expectedLeadershipSlotNumbers \\ leaderSlots) H.assert $ L.null (expectedLeadershipSlotNumbers \\ leaderSlots) -} + H.writeFile "hprop_leadershipSchedule.stop" "hprop_leadershipSchedule" diff --git a/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Cli/Babbage/StakeSnapshot.hs b/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Cli/Babbage/StakeSnapshot.hs index 591fc2ae1a4..35ad31b9e59 100644 --- a/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Cli/Babbage/StakeSnapshot.hs +++ b/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Cli/Babbage/StakeSnapshot.hs @@ -29,10 +29,13 @@ import Testnet.Runtime import Hedgehog (Property, (===)) import qualified Hedgehog as H import qualified Hedgehog.Extras.Stock.IO.Network.Sprocket as IO -import qualified Hedgehog.Extras.Test.Base as H +import qualified Hedgehog.Extras.Test as H hprop_stakeSnapshot :: Property hprop_stakeSnapshot = H.integrationRetryWorkspace 2 "babbage-stake-snapshot" $ \tempAbsBasePath' -> do + H.threadDelay 1000 + H.writeFile "hprop_stakeSnapshot-b.start" "hprop_stakeSnapshot" + H.note_ SYS.os conf@Conf { tempAbsPath } <- mkConf tempAbsBasePath' let tempAbsPath' = unTmpAbsPath tempAbsPath @@ -69,3 +72,5 @@ hprop_stakeSnapshot = H.integrationRetryWorkspace 2 "babbage-stake-snapshot" $ \ Aeson.Object kmPools -> KM.size kmPools === 3 _ -> H.failure _ -> H.failure + + H.writeFile "hprop_stakeSnapshot-b.stop" "hprop_stakeSnapshot" diff --git a/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Cli/Babbage/Transaction.hs b/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Cli/Babbage/Transaction.hs index e6cc3b57c5f..65267664d1a 100644 --- a/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Cli/Babbage/Transaction.hs +++ b/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Cli/Babbage/Transaction.hs @@ -36,11 +36,13 @@ import Testnet.Runtime import Hedgehog (Property) import qualified Hedgehog as H -import qualified Hedgehog.Extras.Test.Base as H -import qualified Hedgehog.Extras.Test.File as H +import qualified Hedgehog.Extras.Test as H hprop_transaction :: Property hprop_transaction = H.integrationRetryWorkspace 0 "babbage-transaction" $ \tempAbsBasePath' -> do + H.threadDelay 1000 + H.writeFile "hprop_transaction-b.start" "hprop_transaction" + H.note_ SYS.os conf@Conf { tempAbsPath } <- mkConf tempAbsBasePath' let tempAbsPath' = unTmpAbsPath tempAbsPath @@ -121,6 +123,7 @@ hprop_transaction = H.integrationRetryWorkspace 0 "babbage-transaction" $ \tempA UTxO utxo2 <- H.noteShowM $ decodeEraUTxO sbe utxo2Json txouts2 <- H.noteShow $ L.unCoin . txOutValueLovelace . txOutValue . snd <$> Map.toList utxo2 H.assert $ 5_000_001 `List.elem` txouts2 + H.writeFile "hprop_transaction-b.stop" "hprop_transaction" txOutValue :: TxOut ctx era -> TxOutValue era txOutValue (TxOut _ v _ _) = v diff --git a/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Cli/Conway/DRepRetirement.hs b/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Cli/Conway/DRepRetirement.hs index 856b3ac3a9b..f9eeabe752c 100644 --- a/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Cli/Conway/DRepRetirement.hs +++ b/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Cli/Conway/DRepRetirement.hs @@ -40,6 +40,9 @@ sbe = ShelleyBasedEraConway -- @DISABLE_RETRIES=1 cabal test cardano-testnet-test --test-options '-p "/DRepRetirement/"'@ hprop_drep_retirement :: Property hprop_drep_retirement = H.integrationRetryWorkspace 2 "drep-retirement" $ \tempAbsBasePath' -> do + H.threadDelay 1000 + H.writeFile "hprop_drep_retirement.start" "hprop_drep_retirement" + -- Start a local test net conf@Conf { tempAbsPath } <- H.noteShowM $ mkConf tempAbsBasePath' let tempAbsPath' = unTmpAbsPath tempAbsPath @@ -141,3 +144,4 @@ hprop_drep_retirement = H.integrationRetryWorkspace 2 "drep-retirement" $ \tempA -- to witness that the number of dreps indeed decreased. checkDRepsNumber sbe configFile' socketPath' execConfig (sizeBefore - 1) H.success + H.writeFile "hprop_drep_retirement.stop" "hprop_drep_retirement" diff --git a/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Cli/Conway/Plutus.hs b/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Cli/Conway/Plutus.hs index 6c1a09f6311..971bf2e7b0e 100644 --- a/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Cli/Conway/Plutus.hs +++ b/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Cli/Conway/Plutus.hs @@ -49,6 +49,9 @@ import qualified Hedgehog.Extras as H -- Proposing NO hprop_plutus_v3 :: Property hprop_plutus_v3 = H.integrationWorkspace "all-plutus-script-purposes" $ \tempAbsBasePath' -> do + H.threadDelay 1000 + H.writeFile "hprop_plutus_v3.start" "hprop_plutus_v3" + H.note_ SYS.os conf@Conf { tempAbsPath } <- mkConf tempAbsBasePath' let tempAbsPath' = unTmpAbsPath tempAbsPath @@ -220,5 +223,6 @@ hprop_plutus_v3 = H.integrationWorkspace "all-plutus-script-purposes" $ \tempAbs , "--tx-file", spendScriptUTxOTx ] H.success + H.writeFile "hprop_plutus_v3.stop" "hprop_plutus_v3" diff --git a/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Cli/Conway/StakeSnapshot.hs b/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Cli/Conway/StakeSnapshot.hs index 8f3cdf289f8..2d07c311952 100644 --- a/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Cli/Conway/StakeSnapshot.hs +++ b/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Cli/Conway/StakeSnapshot.hs @@ -26,10 +26,13 @@ import Testnet.Runtime import Hedgehog (Property, (===)) import qualified Hedgehog as H import qualified Hedgehog.Extras.Stock.IO.Network.Sprocket as IO -import qualified Hedgehog.Extras.Test.Base as H +import qualified Hedgehog.Extras.Test as H hprop_stakeSnapshot :: Property hprop_stakeSnapshot = H.integrationRetryWorkspace 2 "conway-stake-snapshot" $ \tempAbsBasePath' -> do + H.threadDelay 1000 + H.writeFile "hprop_stakeSnapshot-c.start" "hprop_stakeSnapshot" + H.note_ SYS.os conf@Conf { tempAbsPath } <- mkConf tempAbsBasePath' let tempAbsPath' = unTmpAbsPath tempAbsPath @@ -66,3 +69,4 @@ hprop_stakeSnapshot = H.integrationRetryWorkspace 2 "conway-stake-snapshot" $ \t Aeson.Object kmPools -> KM.size kmPools === 3 _ -> H.failure _ -> H.failure + H.writeFile "hprop_stakeSnapshot-c.stop" "hprop_stakeSnapshot" diff --git a/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Cli/KesPeriodInfo.hs b/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Cli/KesPeriodInfo.hs index d90570dcf9a..20fe24d8f4f 100644 --- a/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Cli/KesPeriodInfo.hs +++ b/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Cli/KesPeriodInfo.hs @@ -42,11 +42,13 @@ import Hedgehog (Property) import qualified Hedgehog as H import Hedgehog.Extras (threadDelay) import Hedgehog.Extras.Stock (sprocketSystemName) -import qualified Hedgehog.Extras.Test.Base as H -import qualified Hedgehog.Extras.Test.File as H +import qualified Hedgehog.Extras.Test as H hprop_kes_period_info :: Property hprop_kes_period_info = H.integrationRetryWorkspace 2 "kes-period-info" $ \tempAbsBasePath' -> do + H.threadDelay 1000 + H.writeFile "hprop_kes_period_info.start" "hprop_kes_period_info" + H.note_ SYS.os conf@Conf { tempAbsPath=tempAbsPath@(TmpAbsolutePath work) } -- TODO: Move yaml filepath specification into individual node options @@ -341,3 +343,4 @@ hprop_kes_period_info = H.integrationRetryWorkspace 2 "kes-period-info" $ \tempA spoLogFile <- H.note nodeStdout prop_node_minted_block spoLogFile + H.writeFile "hprop_kes_period_info.stop" "hprop_kes_period_info" diff --git a/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Cli/Queries.hs b/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Cli/Queries.hs index 61ea1f719e0..0821bdc3c71 100644 --- a/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Cli/Queries.hs +++ b/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Cli/Queries.hs @@ -43,6 +43,9 @@ import qualified Hedgehog.Extras.Test.Golden as H -- RECREATE_GOLDEN_FILES=1 as its prefix hprop_cli_queries :: Property hprop_cli_queries = H.integrationWorkspace "cli-queries" $ \tempAbsBasePath' -> do + H.threadDelay 1000 + H.writeFile "hprop_cli_queries.start" "hprop_cli_queries" + conf@Conf { tempAbsPath=tempAbsPath@(TmpAbsolutePath work) } <- mkConf tempAbsBasePath' let tempBaseAbsPath = makeTmpBaseAbsPath tempAbsPath @@ -123,6 +126,7 @@ hprop_cli_queries = H.integrationWorkspace "cli-queries" $ \tempAbsBasePath' -> H.noteM_ $ H.execCli' execConfig [ "conway", "query", "drep-state", "--all-dreps" , "--out-file", drepStateOutFile] _ :: Aeson.Value <- H.leftFailM . H.readJsonFile $ drepStateOutFile + H.writeFile "hprop_cli_queries.stop" "hprop_cli_queries" H.success @@ -152,4 +156,3 @@ assertArrayOfSize v n = failWrongType got = do H.note_ $ "Expected a JSON object, but received: " <> got H.failure - diff --git a/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Cli/QuerySlotNumber.hs b/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Cli/QuerySlotNumber.hs index 0f05e087907..3301b7199fd 100644 --- a/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Cli/QuerySlotNumber.hs +++ b/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/Cli/QuerySlotNumber.hs @@ -31,12 +31,15 @@ import Testnet.Runtime import Hedgehog (Property) import qualified Hedgehog.Extras.Stock as H -import qualified Hedgehog.Extras.Test.Base as H +import qualified Hedgehog.Extras.Test as H import qualified Hedgehog.Internal.Property as H -- | Tests @query slot-number@ cardano-cli command that it returns correct slot numbers for provided utc time hprop_querySlotNumber :: Property hprop_querySlotNumber = H.integrationRetryWorkspace 2 "query-slot-number" $ \tempAbsBasePath' -> do + H.threadDelay 1000 + H.writeFile "hprop_querySlotNumber.start" "hprop_querySlotNumber" + H.note_ SYS.os conf <- mkConf tempAbsBasePath' @@ -119,6 +122,8 @@ hprop_querySlotNumber = H.integrationRetryWorkspace 2 "query-slot-number" $ \tem ] H.assertWith result isLeft + H.writeFile "hprop_querySlotNumber.stop" "hprop_querySlotNumber" + formatTime :: DT.UTCTime -> String formatTime = DT.formatTime DT.defaultTimeLocale "%Y-%m-%dT%H:%M:%SZ" diff --git a/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/FoldBlocks.hs b/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/FoldBlocks.hs index fe797a8f303..ba16e842781 100644 --- a/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/FoldBlocks.hs +++ b/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/FoldBlocks.hs @@ -40,6 +40,9 @@ instance Show FoldBlocksException where -- that main thread blocks on. prop_foldBlocks :: H.Property prop_foldBlocks = H.integrationRetryWorkspace 2 "foldblocks" $ \tempAbsBasePath' -> do + H.threadDelay 1000 + H.writeFile "prop_foldBlocks.start" "prop_foldBlocks" + -- Start testnet conf <- TN.mkConf tempAbsBasePath' @@ -77,4 +80,5 @@ prop_foldBlocks = H.integrationRetryWorkspace 2 "foldblocks" $ \tempAbsBasePath' -- test to finish. _ <- H.evalIO $ H.timeout 30_000_000 $ IO.readMVar lock H.assert True + H.writeFile "prop_foldBlocks.stop" "prop_foldBlocks" diff --git a/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/LedgerEvents/Gov/DRepDeposits.hs b/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/LedgerEvents/Gov/DRepDeposits.hs index 95ccdd1fcdb..910b12e3c16 100644 --- a/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/LedgerEvents/Gov/DRepDeposits.hs +++ b/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/LedgerEvents/Gov/DRepDeposits.hs @@ -36,6 +36,8 @@ import qualified Hedgehog.Extras.Stock.IO.Network.Sprocket as IO -- @DISABLE_RETRIES=1 cabal test cardano-testnet-test --test-options '-p "/DRep Deposits/"'@ hprop_ledger_events_drep_deposits :: Property hprop_ledger_events_drep_deposits = H.integrationWorkspace "drep-deposits" $ \tempAbsBasePath' -> do + H.threadDelay 1000 + H.writeFile "hprop_ledger_events_drep_deposits.start" "hprop_ledger_events_drep_deposits" -- Start a local test net conf@Conf { tempAbsPath } <- mkConf tempAbsBasePath' @@ -110,5 +112,6 @@ hprop_ledger_events_drep_deposits = H.integrationWorkspace "drep-deposits" $ \te checkDRepState sbe (File configurationFile) (File socketPath) execConfig (\m -> if map L.drepDeposit (Map.elems m) == [L.Coin minDRepDeposit] then Just () else Nothing) + H.writeFile "hprop_ledger_events_drep_deposits.stop" "hprop_ledger_events_drep_deposits" diff --git a/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/LedgerEvents/Gov/InfoAction.hs b/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/LedgerEvents/Gov/InfoAction.hs index 8ad95db8b6f..7067657c7ed 100644 --- a/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/LedgerEvents/Gov/InfoAction.hs +++ b/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/LedgerEvents/Gov/InfoAction.hs @@ -46,6 +46,8 @@ import qualified Hedgehog.Extras.Stock.IO.Network.Sprocket as IO -- @DISABLE_RETRIES=1 cabal test cardano-testnet-test --test-options '-p "/InfoAction/'@ hprop_ledger_events_info_action :: Property hprop_ledger_events_info_action = H.integrationRetryWorkspace 0 "info-hash" $ \tempAbsBasePath' -> do + H.threadDelay 1000 + H.writeFile "hprop_ledger_events_info_action.start" "hprop_ledger_events_info_action" -- Start a local test net conf@Conf { tempAbsPath } <- H.noteShowM $ mkConf tempAbsBasePath' @@ -225,6 +227,7 @@ hprop_ledger_events_info_action = H.integrationRetryWorkspace 0 "info-hash" $ \t H.failMessage callStack $ "foldBlocksCheckInfoAction failed with: " <> displayError e Right _events -> success + H.writeFile "hprop_ledger_events_info_action.stop" "hprop_ledger_events_info_action" -- | Fold accumulator for checking action state data InfoActionState = InfoActionState diff --git a/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/LedgerEvents/Gov/ProposeNewConstitution.hs b/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/LedgerEvents/Gov/ProposeNewConstitution.hs index 780ad41b140..cefadfd7ea4 100644 --- a/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/LedgerEvents/Gov/ProposeNewConstitution.hs +++ b/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/LedgerEvents/Gov/ProposeNewConstitution.hs @@ -53,6 +53,9 @@ import qualified Hedgehog.Extras.Stock.IO.Network.Sprocket as IO -- @DISABLE_RETRIES=1 cabal test cardano-testnet-test --test-options '-p "/ProposeAndRatifyNewConstitution/"'@ hprop_ledger_events_propose_new_constitution :: Property hprop_ledger_events_propose_new_constitution = H.integrationWorkspace "propose-new-constitution" $ \tempAbsBasePath' -> do + H.threadDelay 1000 + H.writeFile "hprop_ledger_events_propose_new_constitution.start" "hprop_ledger_events_propose_new_constitution" + -- Start a local test net conf@Conf { tempAbsPath } <- mkConf tempAbsBasePath' let tempAbsPath' = unTmpAbsPath tempAbsPath @@ -279,6 +282,7 @@ hprop_ledger_events_propose_new_constitution = H.integrationWorkspace "propose-n length (filter (== "VoteNo") votes) === 3 length (filter (== "Abstain") votes) === 2 length votes === numVotes + H.writeFile "hprop_ledger_events_propose_new_constitution.stop" "hprop_ledger_events_propose_new_constitution" foldBlocksCheckConstitutionWasRatified :: String -- submitted constitution hash diff --git a/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/LedgerEvents/Gov/ProposeNewConstitutionSPO.hs b/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/LedgerEvents/Gov/ProposeNewConstitutionSPO.hs index c8d2fe034bc..b995ac4cc62 100644 --- a/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/LedgerEvents/Gov/ProposeNewConstitutionSPO.hs +++ b/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/LedgerEvents/Gov/ProposeNewConstitutionSPO.hs @@ -52,6 +52,9 @@ import qualified Hedgehog.Extras.Stock.IO.Network.Sprocket as IO -- @cabal test cardano-testnet-test --test-options '-p "/ProposeNewConstitutionSPO/"'@ hprop_ledger_events_propose_new_constitution_spo :: Property hprop_ledger_events_propose_new_constitution_spo = H.integrationWorkspace "propose-new-constitution-spo" $ \tempAbsBasePath' -> do + H.threadDelay 1000 + H.writeFile "hprop_ledger_events_propose_new_constitution_spo.start" "hprop_ledger_events_propose_new_constitution_spo" + conf@Conf { tempAbsPath=tempAbsPath@(TmpAbsolutePath work) } <- mkConf tempAbsBasePath' let tempAbsPath' = unTmpAbsPath tempAbsPath @@ -224,6 +227,7 @@ hprop_ledger_events_propose_new_constitution_spo = H.integrationWorkspace "propo exitCode H./== ExitSuccess -- Dit it fail? H.assert $ "DisallowedVoters" `isInfixOf` stderr -- Did it fail for the expected reason? + H.writeFile "hprop_ledger_events_propose_new_constitution_spo.stop" "hprop_ledger_events_propose_new_constitution_spo" getConstitutionProposal :: (HasCallStack, MonadCatch m, MonadIO m, MonadTest m) diff --git a/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/LedgerEvents/SanityCheck.hs b/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/LedgerEvents/SanityCheck.hs index fd3a067e122..c40fe46bbf6 100644 --- a/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/LedgerEvents/SanityCheck.hs +++ b/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/LedgerEvents/SanityCheck.hs @@ -25,7 +25,7 @@ import Testnet.Runtime import Hedgehog import qualified Hedgehog.Extras.Stock.IO.Network.Sprocket as IO -import qualified Hedgehog.Extras.Test.Base as H +import qualified Hedgehog.Extras.Test as H newtype AdditionalCatcher = IOE IOException @@ -42,6 +42,9 @@ newtype AdditionalCatcher -- setting timeouts for expected results etc. hprop_ledger_events_sanity_check :: Property hprop_ledger_events_sanity_check = H.integrationWorkspace "ledger-events-sanity-check" $ \tempAbsBasePath' -> do + H.threadDelay 1000 + H.writeFile "hprop_ledger_events_sanity_check.start" "hprop_ledger_events_sanity_check" + -- Start a local test net conf <- mkConf tempAbsBasePath' @@ -75,6 +78,7 @@ hprop_ledger_events_sanity_check = H.integrationWorkspace "ledger-events-sanity- Right (Left e) -> H.failMessage callStack $ "foldBlocks failed with: " <> displayError e Right (Right _v) -> success + H.writeFile "hprop_ledger_events_sanity_check.stop" "hprop_ledger_events_sanity_check" foldBlocksAccumulator diff --git a/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/LedgerEvents/TreasuryGrowth.hs b/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/LedgerEvents/TreasuryGrowth.hs index d4cd5ae18bd..3c83281fa72 100644 --- a/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/LedgerEvents/TreasuryGrowth.hs +++ b/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/LedgerEvents/TreasuryGrowth.hs @@ -32,6 +32,9 @@ import qualified Hedgehog.Extras.Test as H -- @DISABLE_RETRIES=1 cabal test cardano-testnet-test --test-options '-p "/Treasury Growth/"'@ prop_check_if_treasury_is_growing :: H.Property prop_check_if_treasury_is_growing = H.integrationRetryWorkspace 0 "growing-treasury" $ \tempAbsBasePath' -> do + H.threadDelay 1000 + H.writeFile "prop_check_if_treasury_is_growing.start" "prop_check_if_treasury_is_growing" + -- Start testnet conf@Conf{tempAbsPath=TmpAbsolutePath tempAbsPath'} <- TN.mkConf tempAbsBasePath' @@ -67,6 +70,7 @@ prop_check_if_treasury_is_growing = H.integrationRetryWorkspace 0 "growing-treas else do H.note_ "treasury is not growing" H.failure + H.writeFile "prop_check_if_treasury_is_growing.stop" "prop_check_if_treasury_is_growing" where handler :: AnyNewEpochState -> SlotNo -> BlockNo -> StateT (Map EpochNo Integer) IO LedgerStateCondition handler (AnyNewEpochState _ newEpochState) _slotNo _blockNo = do 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 74cad2932e8..af2817cce0f 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 @@ -184,6 +184,9 @@ hprop_shutdown = H.integrationRetryWorkspace 2 "shutdown" $ \tempAbsBasePath' -> hprop_shutdownOnSlotSynced :: Property hprop_shutdownOnSlotSynced = H.integrationRetryWorkspace 2 "shutdown-on-slot-synced" $ \tempAbsBasePath' -> do + H.threadDelay 1000 + H.writeFile "hprop_shutdownOnSlotSynced.start" "hprop_shutdownOnSlotSynced" + -- Start a local test net -- TODO: Move yaml filepath specification into individual node options conf <- mkConf tempAbsBasePath' @@ -228,11 +231,15 @@ hprop_shutdownOnSlotSynced = H.integrationRetryWorkspace 2 "shutdown-on-slot-syn let epsilon = 50 H.assertWithinTolerance slotTip maxSlot epsilon + H.writeFile "hprop_shutdownOnSlotSynced.stop" "hprop_shutdownOnSlotSynced" -- Execute this test with: -- @DISABLE_RETRIES=1 cabal test cardano-testnet-test --test-options '-p "/ShutdownOnSigint/"'@ hprop_shutdownOnSigint :: Property hprop_shutdownOnSigint = H.integrationRetryWorkspace 2 "shutdown-on-sigint" $ \tempAbsBasePath' -> do + H.threadDelay 1000 + H.writeFile "hprop_shutdownOnSigint.start" "hprop_shutdownOnSigint" + -- Start a local test net -- TODO: Move yaml filepath specification into individual node options conf <- mkConf tempAbsBasePath' @@ -263,6 +270,7 @@ hprop_shutdownOnSigint = H.integrationRetryWorkspace 2 "shutdown-on-sigint" $ \t [] -> H.failMessage callStack "Could not find close DB message." (Left err):_ -> H.failMessage callStack err (Right _):_ -> pure () + H.writeFile "hprop_shutdownOnSigint.stop" "hprop_shutdownOnSigint" parseMsg :: String -> Maybe (Either String Integer) diff --git a/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/SubmitApi/Babbage/Transaction.hs b/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/SubmitApi/Babbage/Transaction.hs index e27b5e44a99..1e9ff932bdf 100644 --- a/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/SubmitApi/Babbage/Transaction.hs +++ b/cardano-testnet/test/cardano-testnet-test/Cardano/Testnet/Test/SubmitApi/Babbage/Transaction.hs @@ -44,12 +44,14 @@ import Testnet.SubmitApi import Hedgehog (Property, (===)) import qualified Hedgehog as H -import qualified Hedgehog.Extras.Test.Base as H -import qualified Hedgehog.Extras.Test.File as H +import qualified Hedgehog.Extras.Test as H import qualified Hedgehog.Extras.Test.Golden as H hprop_transaction :: Property hprop_transaction = H.integrationRetryWorkspace 0 "submit-api-babbage-transaction" $ \tempAbsBasePath' -> do + H.threadDelay 1000 + H.writeFile "hprop_transaction-c.start" "hprop_transaction" + H.note_ SYS.os conf@Conf { tempAbsPath } <- mkConf tempAbsBasePath' let tempAbsPath' = unTmpAbsPath tempAbsPath @@ -188,6 +190,7 @@ hprop_transaction = H.integrationRetryWorkspace 0 "submit-api-babbage-transactio H.evalIO $ LBS.writeFile txFailedResponseYamlFp $ Aeson.encodePretty v H.diffFileVsGoldenFile txFailedResponseYamlFp txFailedResponseYamlGoldenFp + H.writeFile "hprop_transaction-c.stop" "hprop_transaction" redactHashLbs :: LBS.ByteString -> LBS.ByteString redactHashLbs = diff --git a/timings.sh b/timings.sh new file mode 100755 index 00000000000..178735f22f1 --- /dev/null +++ b/timings.sh @@ -0,0 +1,5 @@ +#!/usr/bin/env bash + +( cd cardano-testnet + stat -c "%y %n" * | grep '\(start\|stop\)' | sort +)