Skip to content

Fix flaky MultiAssetReturnCollateral test#6504

Open
Jimbo4350 wants to merge 2 commits intomasterfrom
fix/flaky-multiasset-collateral-test
Open

Fix flaky MultiAssetReturnCollateral test#6504
Jimbo4350 wants to merge 2 commits intomasterfrom
fix/flaky-multiasset-collateral-test

Conversation

@Jimbo4350
Copy link
Copy Markdown
Contributor

Summary

  • Replace fixed 1-block wait + single query with retryUntilJustM polling (up to 10 blocks) for the multi-asset UTxO in hprop_collateral_with_tokens
  • The mint transaction may not be confirmed within a single block, causing findLargestMultiAssetUtxoWithAddress to return Nothing and the test to fail spuriously
  • This matches the retry pattern already used for the script address UTxO lookup on the next line

Test plan

  • CI passes the Collateral With Multiassets test on aarch64-linux (previously failing: check run 69208753482)

🤖 Generated with Claude Code

@Jimbo4350 Jimbo4350 requested a review from a team as a code owner March 30, 2026 17:44
@Jimbo4350 Jimbo4350 force-pushed the fix/flaky-multiasset-collateral-test branch from c7cc8d9 to bf80309 Compare March 31, 2026 12:53
@Jimbo4350 Jimbo4350 enabled auto-merge March 31, 2026 12:54
-- Find the UTxO with tokens at wallet1 (for collateral)
txinCollateralWithTokensM <-
-- Find the UTxO with tokens at wallet2 (for collateral)
(txinCollateralWithTokens, collateralTxOut) <- retryUntilJustM epochStateView (WaitForBlocks 10) $
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The mint transaction may not be confirmed within a single block, causing findLargestMultiAssetUtxoWithAddress to return Nothing and the test to fail spuriously

When this happens? Why it may not get confirmed within a single block?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hard to say exactly, but maybe a block gets forged before the tx has time to enter the mempool. We then wait for that block and query the node state, but it still reflects the pre-tx state. The tx only gets included in the next block, which updates the node state but by then the test has already failed.

Copy link
Copy Markdown
Contributor

@carbolymer carbolymer Mar 31, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test should use integrationRetryWorkspace instead of integrationWorkspace

@Jimbo4350 Jimbo4350 force-pushed the fix/flaky-multiasset-collateral-test branch from d36573e to 014595c Compare March 31, 2026 14:35
@Jimbo4350 Jimbo4350 added this pull request to the merge queue Mar 31, 2026
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Mar 31, 2026
@Jimbo4350 Jimbo4350 added this pull request to the merge queue Mar 31, 2026
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to no response for status checks Mar 31, 2026
@Jimbo4350 Jimbo4350 added this pull request to the merge queue Mar 31, 2026
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Mar 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants