Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix flakey CertifyingAndWithdrawingPlutus test with longer waits for Linux #477

Merged
merged 1 commit into from
May 24, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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