Skip to content

Wait for address association before balance assertions#3584

Merged
masih merged 1 commit into
mainfrom
masih/fix-autobahn-flake-it
Jun 15, 2026
Merged

Wait for address association before balance assertions#3584
masih merged 1 commit into
mainfrom
masih/fix-autobahn-flake-it

Conversation

@masih

@masih masih commented Jun 15, 2026

Copy link
Copy Markdown
Collaborator

The Autobahn associate-balance test was flaky because associateKeyStrict returned after submitting seid tx evm associate-address and waiting a fixed number of blocks. In the failing run, the associate transaction had returned, but the EVM/Sei address association was not visible to the balance query yet, so the test read the pre-association EVM balance (200) instead of the expected converted Sei balance.

Fix this by waiting on the causal post-state: query seid q evm evm-addr until it reports associated: true for the Sei address. This makes the test proceed only once the association side effect is observable, instead of relying on block timing.

Flaked here.

The Autobahn associate-balance test was flaky because `associateKeyStrict`
returned after submitting `seid tx evm associate-address` and waiting a fixed
number of blocks. In the failing run, the associate transaction had returned,
but the EVM/Sei address association was not visible to the balance query yet,
so the test read the pre-association EVM balance (`200`) instead of the expected
converted Sei balance.

Fix this by waiting on the causal post-state: query `seid q evm evm-addr` until
it reports `associated: true` for the Sei address. This makes the test proceed
only once the association side effect is observable, instead of relying on block
timing.

Flaked [here](https://github.com/sei-protocol/sei-chain/actions/runs/27301809780/job/80650521620).
@masih masih marked this pull request as ready for review June 15, 2026 08:16
@cursor

cursor Bot commented Jun 15, 2026

Copy link
Copy Markdown

PR Summary

Low Risk
Test-only changes in contracts/test/lib.js with no production or chain logic impact.

Overview
associateKeyStrict no longer uses a fixed waitForBlocks after associate-address. It polls seid q evm evm-addr until associated: true for the key’s Sei address, using the existing waitForCondition pattern used elsewhere in the test lib.

A new getEvmAddressAssociation helper returns the full query JSON; getEvmAddress now reads evm_address from that response instead of parsing the query inline.

This targets Autobahn flakiness where associate-balance tests asserted balances before the association was visible to queries.

Reviewed by Cursor Bugbot for commit 5f0ef68. Bugbot is set up for automated code reviews on this repo. Configure here.

@github-actions

github-actions Bot commented Jun 15, 2026

Copy link
Copy Markdown

The latest Buf updates on your PR. Results from workflow Buf / buf (pull_request).

BuildFormatLintBreakingUpdated (UTC)
✅ passed✅ passed✅ passed✅ passedJun 15, 2026, 8:18 AM

@masih masih requested review from codchen and pompon0 June 15, 2026 08:18
@masih masih enabled auto-merge June 15, 2026 08:19
@codecov

codecov Bot commented Jun 15, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 58.35%. Comparing base (0a2c388) to head (5f0ef68).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #3584      +/-   ##
==========================================
- Coverage   59.22%   58.35%   -0.87%     
==========================================
  Files        2214     2140      -74     
  Lines      183389   174842    -8547     
==========================================
- Hits       108604   102031    -6573     
+ Misses      64994    63720    -1274     
+ Partials     9791     9091     -700     
Flag Coverage Δ
sei-db 70.41% <ø> (ø)
sei-db-state-db ?

Flags with carried forward coverage won't be shown. Click here to find out more.
see 74 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@masih masih added this pull request to the merge queue Jun 15, 2026
Merged via the queue into main with commit e355f1d Jun 15, 2026
95 of 98 checks passed
@masih masih deleted the masih/fix-autobahn-flake-it branch June 15, 2026 09:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants