fix(e2e): wait for the asset page before reading the balance in disaster recovery - #668
Merged
Merged
Conversation
The test shares one budget across a long flow and contained two loops that could not fail on their own: one polling the station module hash, one polling for the restored balance. Whichever step happened to be slowest consumed the budget, and the failure was reported as a timeout inside whichever wait the test was sitting in, which is why the reported line moves between steps across runs. Both loops become bounded polls with their own timeouts and messages, so a step that does not complete fails against that step and reports the value it last read. The entry point into the recovery page is also waited for rather than clicked immediately, since it only appears once the wallet has noticed the station is uninstalled.
|
✅ No security or compliance issues detected. Reviewed everything up to 9762732. Security OverviewDetected Code Changes
|
Contributor
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The test-only changes preserve existing assertions while adding appropriate phase-specific bounds and diagnostics.
Review effort: Balanced
Findings: None
What changed in this PR
Bounds disaster-recovery E2E polling so failures identify the stalled phase and last observed value.
Changes:
- Replaces unbounded module-hash and balance loops with timed
expect.poll. - Waits explicitly for the disaster-recovery entry point.
| File | Description |
|---|---|
tests/e2e/page-objects/settings.page.ts |
Bounds custom WASM installation polling. |
tests/e2e/disaster-recovery.spec.ts |
Bounds recovery waits and improves diagnostics. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
The bounded wait added in the previous commit reported what the test was actually reading: the account name, never a balance. Clicking an asset starts a client side navigation that the test did not wait for, so the reload that followed re-rendered the account page, whose header is the account name, and every later read was taken from there. pickByAsset now waits for the nested asset route, and the balance check waits on the live header instead of reloading. The page refreshes its own balance every five seconds, so the reload was never needed and only served to race the navigation.
MRmarioruci
enabled auto-merge (squash)
September 21, 2026 10:14
sea-snake
approved these changes
Sep 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
can recover uninstalled stationfails often onmain, and the reported line moved between steps across runs: 55, 71, 72 and 78. That was one symptom, not four.The test shared a single 600s budget across a long flow, and two loops inside it could not fail on their own: one polling the station module hash, one polling for the restored balance. Whichever step was slowest consumed the budget, and the failure surfaced as a timeout inside whichever wait the test happened to be in, pointing at a step that was often not the slow one and never saying what it had observed.
Bounding those waits produced the real error:
The test was reading
"Main", the account name, and never a balance. Clicking an asset starts a client side navigation that the test did not wait for, so thepage.reload()immediately after re-rendered the account page rather than the asset page. The account page header is the account name, so every subsequent read returned"Main"and the loop could never succeed. The asset page header is either the balance or a placeholder, never an account name, which is what made the value diagnostic.Changes
pickByAssetwaits for the nested/accounts/:accountId/:assetIdroute, so the click is known to have navigated before anything reads the header. The balance check waits on the live header through a newexpectBalance, rather than reloading in a loop:AccountAssetPagemounts itsDataLoaderwithrefresh-interval-ms="5000"and never disables it, so the page refreshes its own balance and the reload was never needed. It only served to race the pending navigation. The module hash wait ininstallCustomWasmstays a bounded poll so a wasm that never installs fails against that step with its own message.Note
The first commit here is the bounded waits that produced the diagnosis; the second is the fix. Keeping both makes the reasoning reviewable, and the bounded module hash wait is worth keeping on its own.