Skip to content

Commit

Permalink
Reenable DRep Activity test and kick watchdog
Browse files Browse the repository at this point in the history
  • Loading branch information
palas committed May 7, 2024
1 parent 569c903 commit 711e7fe
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ import qualified Hedgehog.Extras.Stock.IO.Network.Sprocket as IO
-- | Execute me with:
-- @DISABLE_RETRIES=1 cabal test cardano-testnet-test --test-options '-p "/DRep Activity/"'@
hprop_check_drep_activity :: Property
hprop_check_drep_activity = H.integrationWorkspace "test-activity" $ \tempAbsBasePath' -> runWithDefaultWatchdog_ $ do
hprop_check_drep_activity = H.integrationWorkspace "test-activity" $ \tempAbsBasePath' -> runWithDefaultWatchdog $ \watchdog -> do
-- Start a local test net
conf@Conf { tempAbsPath } <- mkConf tempAbsBasePath'
let tempAbsPath' = unTmpAbsPath tempAbsPath
Expand Down Expand Up @@ -114,6 +114,7 @@ hprop_check_drep_activity = H.integrationWorkspace "test-activity" $ \tempAbsBas
delegateToDRep execConfig epochStateView configurationFile socketPath sbe work "drep3-delegation"
wallet1 (defaultDelegatorStakeKeyPair 3) drep3


expirationDates <- checkDRepState epochStateView sbe $ \m ->
if length m == 3
then Just $ Map.map drepExpiry m
Expand All @@ -128,16 +129,18 @@ hprop_check_drep_activity = H.integrationWorkspace "test-activity" $ \tempAbsBas
minEpochsToWaitIfNotChanging (Just firstTargetDRepActivity)
maxEpochsToWaitAfterProposal

kickWatchdog watchdog

-- We now send a bunch of proposals to make sure that the 2 new DReps expire.
-- because DReps won't expire if there is not enough activity (opportunites to participate).
-- This is accounted for by the dormant epoch count
let numOfFillerProposals = 4 :: Int
sequence_
[activityChangeProposalTest execConfig epochStateView configurationFile socketPath ceo gov
("fillerProposalNum" ++ show proposalNum) wallet [(1, "yes")]
(secondTargetDRepActivity + fromIntegral proposalNum)
minEpochsToWaitIfNotChanging Nothing
maxEpochsToWaitAfterProposal
[ activityChangeProposalTest execConfig epochStateView configurationFile socketPath ceo gov
("fillerProposalNum" ++ show proposalNum) wallet [(1, "yes")]
(secondTargetDRepActivity + fromIntegral proposalNum)
minEpochsToWaitIfNotChanging Nothing
maxEpochsToWaitAfterProposal
| (proposalNum, wallet) <- zip [1..numOfFillerProposals] (cycle [wallet0, wallet1, wallet2])]

(EpochNo epochAfterTimeout) <- getCurrentEpochNo epochStateView
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ import Test.Tasty (TestTree)
import qualified Test.Tasty.Ingredients as T
import qualified Test.Tasty.Options as T
import qualified Test.Tasty.Runners as T
import qualified Cardano.Testnet.Test.Gov.DRepActivity as Cardano.Testnet.Test.LedgerEvents.Gov.DRepActivity

tests :: IO TestTree
tests = do
Expand All @@ -48,8 +49,7 @@ tests = do
-- TODO: Replace foldBlocks with checkLedgerStateCondition
, T.testGroup "Governance"
[ H.ignoreOnMacAndWindows "ProposeAndRatifyNewConstitution" Cardano.Testnet.Test.Gov.ProposeNewConstitution.hprop_ledger_events_propose_new_constitution
-- TODO: "DRep Activity" is too flaky at the moment. Disabling until we can fix it.
-- , H.ignoreOnWindows "DRep Activity" Cardano.Testnet.Test.LedgerEvents.Gov.DRepActivity.hprop_check_drep_activity
, H.ignoreOnWindows "DRep Activity" Cardano.Testnet.Test.LedgerEvents.Gov.DRepActivity.hprop_check_drep_activity
, H.ignoreOnWindows "DRep Deposits" Cardano.Testnet.Test.Gov.DRepDeposits.hprop_ledger_events_drep_deposits
-- FIXME Those tests are flaky
-- , H.ignoreOnWindows "InfoAction" LedgerEvents.hprop_ledger_events_info_action
Expand Down

0 comments on commit 711e7fe

Please sign in to comment.