Skip to content

test(e2e): bound the waits in the disaster recovery test - #668

Open
MRmarioruci wants to merge 1 commit into
mainfrom
fix/e2e-disaster-recovery-bounded-waits
Open

MRmarioruci wants to merge 1 commit into
mainfrom
fix/e2e-disaster-recovery-bounded-waits

Conversation

@MRmarioruci

Copy link
Copy Markdown
Contributor

Problem

can recover uninstalled station fails often on main, and the reported line moves between steps across runs: 55, 71, 72 and 78 in recent runs. That is one symptom, not four.

The test shares a single 600s budget across register, create station, top up, install a custom wasm, recover, verify balance. Inside that budget sat two loops that could not fail on their own:

  • installCustomWasm polled the module hash in a while loop paced by waitForTimeout(1000)
  • the spec polled for the restored balance in a while (true) paced by waitForTimeout(5000)

Neither had an exit other than success, so whichever step was slowest on a given run consumed the remaining budget, and Playwright reported the failure as a timeout inside whichever waitForTimeout it happened to be in. The error therefore pointed at a step that was often not the slow one, and never said what it had actually observed.

Changes

Both loops become expect.poll with their own timeout and message, sized to fit inside the existing 600s budget so the phase bound is what fires rather than the shared one. A step that does not complete now fails against that step and reports the value it last read, for example the balance it actually saw instead of waitForTimeout exceeded. The entry point into the recovery page is waited for before being clicked, since it only appears once the wallet has noticed the station is uninstalled, and the locator is narrowed to the first match.

Note

This is a diagnosis change, not a claim that the test will now pass. If the balance genuinely does not return after a recovery, this makes that visible and attributable instead of hiding it behind a shared timeout. The test does currently pass on some runs, which points at slowness rather than a hard break, but the current failure mode is not specific enough to say so with confidence.

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.
@MRmarioruci
MRmarioruci requested a review from a team as a code owner September 18, 2026 17:08
@zeropath-ai

zeropath-ai Bot commented Sep 18, 2026

Copy link
Copy Markdown

No security or compliance issues detected. Reviewed everything up to 0325922.

Security Overview
Detected Code Changes
Change Type Relevant files
Enhancement ► tests/e2e/disaster-recovery.spec.ts
    Replace direct click with bounded wait and improve stability of disaster recovery flow
► tests/e2e/page-objects/settings.page.ts
    Replace loop polling with bounded expect.poll for module hash change

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.

1 participant