Skip to content

Commit

Permalink
Reenable DRep Activity and shield foldEpochState
Browse files Browse the repository at this point in the history
  • Loading branch information
palas committed May 7, 2024
1 parent 569c903 commit ac6c948
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import Cardano.Testnet

import Prelude

import Control.Concurrent.Async (race)
import Control.Monad
import Control.Monad.Catch (MonadCatch)
import Control.Monad.Trans.State.Strict (StateT)
Expand Down Expand Up @@ -201,15 +202,18 @@ activityChangeProposalTest execConfig epochStateView configurationFile socketPat
=> Word64 -> m ()
waitAndCheck epochAfterProp = do
!eProposalResult
<- evalIO . runExceptT $ foldEpochState
(File configurationFile)
(File socketPath)
FullValidation
(EpochNo (epochAfterProp + maxWait))
()
(\epochState _ _ -> filterEpochState (isSuccess epochAfterProp) epochState)
<- evalIO . raceTwo . runExceptT $ foldEpochState
(File configurationFile)
(File socketPath)
FullValidation
(EpochNo (epochAfterProp + maxWait))
()
(\epochState _ _ -> filterEpochState (isSuccess epochAfterProp) epochState)
void $ evalEither eProposalResult

raceTwo :: IO a -> IO a
raceTwo computation = race computation computation >>= either pure pure

filterEpochState :: (EpochNo -> EpochInterval -> Bool) -> AnyNewEpochState -> StateT () IO LedgerStateCondition
filterEpochState f (AnyNewEpochState sbe newEpochState) =
caseShelleyToBabbageOrConwayEraOnwards
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 ac6c948

Please sign in to comment.