Skip to content

chore(ci): poll XBTC balance after transfer to avoid solo block race - #1317

Merged
33cn merged 1 commit into
33cn:masterfrom
bysomeone:fix/rgbx-ci-transfer-flake
Sep 3, 2026
Merged

chore(ci): poll XBTC balance after transfer to avoid solo block race#1317
33cn merged 1 commit into
33cn:masterfrom
bysomeone:fix/rgbx-ci-transfer-flake

Conversation

@bysomeone

Copy link
Copy Markdown
Collaborator

Problem

ci_rgbx intermittently fails (same head sometimes red, sometimes green — e.g. run 33594327164 failed while 33594329896 on the same commit passed) in scenario_user_transfer_crosschain_asset.

send rgbx transfer only puts the tx into the main-chain mempool; solo block production + execution takes time. The test then queried both balances once, immediately and asserted exact equality. On a slow/loaded CI runner the ~1s between send and the query is not always enough for the block to land, so the assertion trips (fail log: user A balance still 0.2000, expected 0.1950, ~0.2s short of the passing case). The # tx_wait that would have handled this was commented out from the start.

Fix

In scenario_user_transfer_crosschain_asset, after send:

  • compute the expected balances from the pre-transfer values,
  • poll wait_xbtc_balance_not_less_than until user B actually receives the amount (the tx is atomic, so B receiving implies A was debited),
  • then read both balances and keep the original exact assertions.

This matches the polling pattern already used by the deposit/withdraw scenarios in the same file. Test-only change; no product logic.

Verification

  • bash -n passes.
  • ci_rgbx should no longer flake on the transfer step.

send rgbx transfer only puts the tx into the main-chain mempool; solo
block production + exec takes time. Querying balances immediately after
send races the block landing and intermittently fails ci_rgbx. Compute the
expected balances, poll wait_xbtc_balance_not_less_than until user B
receives the amount (atomic tx: B receiving implies A debited), then assert.
Test-only change: no version release.

Co-authored-by: Claude <noreply@anthropic.com>
@bysomeone
bysomeone force-pushed the fix/rgbx-ci-transfer-flake branch from 9d45621 to 8e7dc9c Compare September 2, 2026 06:27
@bysomeone bysomeone changed the title fix(rgbx-ci): poll XBTC balance after transfer to avoid solo block race chore(ci): poll XBTC balance after transfer to avoid solo block race Sep 2, 2026
@bysomeone
bysomeone requested a review from 33cn September 2, 2026 10:58
@33cn
33cn merged commit 31e006a into 33cn:master Sep 3, 2026
15 checks passed
@33cn

33cn commented Sep 4, 2026

Copy link
Copy Markdown
Owner

🎉 This PR is included in version 1.72.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@33cn 33cn added the released label Sep 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants