Skip to content

Commit

Permalink
Fix flakey CertifyingAndWithdrawingPlutus test with longer waits for …
Browse files Browse the repository at this point in the history
…Linux (#477)
  • Loading branch information
catch-21 authored May 24, 2022
1 parent 700c582 commit 4792047
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions plutus-contract/test/Spec/TimeValidity.hs
Original file line number Diff line number Diff line change
Expand Up @@ -46,18 +46,18 @@ contract = do
logInfo @String $ "now: " ++ show now
let lookups1 = Constraints.typedValidatorLookups $ typedValidator deadline
tx1 = Constraints.mustPayToTheScript () (Ada.lovelaceValueOf 25000000)
ledgerTx1 <- submitTxConstraintsWith @UnitTest lookups1 tx1
ledgerTx1 <- submitTxConstraintsWith lookups1 tx1
awaitTxConfirmed $ Tx.getCardanoTxId ledgerTx1
utxos <- utxosAt scrAddress
let orefs = fst <$> Map.toList utxos
lookups =
lookups2 =
Constraints.otherScript (validatorScript deadline)
<> Constraints.unspentOutputs utxos
tx2 =
foldMap (\oref -> Constraints.mustSpendScriptOutput oref unitRedeemer) orefs
<> Constraints.mustIncludeDatum unitDatum
<> Constraints.mustValidateIn (from $ now + 1000)
ledgerTx2 <- submitTxConstraintsWith @Void lookups tx2
ledgerTx2 <- submitTxConstraintsWith @Void lookups2 tx2
awaitTxConfirmed $ Tx.getCardanoTxId ledgerTx2

trace :: Trace.EmulatorTrace ()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ hprop_plutus_certifying_withdrawing = H.integration . H.runFinallies . H.workspa

-- Things take long on non-linux machines
if isLinux
then H.threadDelay 5000000
then H.threadDelay 8000000
else H.threadDelay 10000000

-- Check to see if pledge's stake address was registered
Expand Down Expand Up @@ -358,7 +358,7 @@ hprop_plutus_certifying_withdrawing = H.integration . H.runFinallies . H.workspa
]

if isLinux
then H.threadDelay 5000000
then H.threadDelay 10000000
else H.threadDelay 20000000

void $ H.execCli' execConfig
Expand Down Expand Up @@ -530,8 +530,8 @@ hprop_plutus_certifying_withdrawing = H.integration . H.runFinallies . H.workspa
, "--testnet-magic", show @Int testnetMagic
]

-- Wait 5 seconds
H.threadDelay 5000000
-- Wait 8 seconds
H.threadDelay 8000000

H.note_ "Check to see if staking script was delegated"

Expand Down Expand Up @@ -693,7 +693,7 @@ hprop_plutus_certifying_withdrawing = H.integration . H.runFinallies . H.workspa

-- Things take long on non-linux machines
if isLinux
then H.threadDelay 5000000
then H.threadDelay 8000000
else H.threadDelay 10000000

H.note_ "Check UTxO at script staking address to see if withdrawal was successful"
Expand Down

0 comments on commit 4792047

Please sign in to comment.