Skip to content

test: adds a retry to transaction finalized event checks#29855

Merged
christopherferreira9 merged 1 commit into
mainfrom
cferreira/add-retry-to-transaction-finalized
May 7, 2026
Merged

test: adds a retry to transaction finalized event checks#29855
christopherferreira9 merged 1 commit into
mainfrom
cferreira/add-retry-to-transaction-finalized

Conversation

@christopherferreira9

@christopherferreira9 christopherferreira9 commented May 7, 2026

Copy link
Copy Markdown
Contributor

Description

The Transaction Finalized event may not be fired immediately so there is a race condition between the E2E check and the timing for the event to be fired. This PR adds a retry mechanism to want a maximum of 5s before actually throwing the error when the event is not fired at all.

Changelog

CHANGELOG entry:

Related issues

Fixes: https://consensys.slack.com/archives/C02U025CVU4/p1778143821257179

Manual testing steps

N/A

Screenshots/Recordings

Before

N/A

After

N/A

Pre-merge author checklist

Performance checks (if applicable)

  • I've tested on Android
    • Ideally on a mid-range device; emulator is acceptable
  • I've tested with a power user scenario
    • Use these power-user SRPs to import wallets with many accounts and tokens
  • I've instrumented key operations with Sentry traces for production performance metrics

For performance guidelines and tooling, see the Performance Guide.

Pre-merge reviewer checklist

  • I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed).
  • I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.

Note

Low Risk
Low risk: test-only change that adds polling before failing when the analytics event arrives late; no production logic is affected.

Overview
Reduces flakiness in the send confirmation smoke test by polling for the Transaction Finalized MetaMetrics event (up to 5 attempts with a 1s delay) before failing the transaction-hash validation.

Also updates the helper to import and use the EventPayload type for the retried lookup.

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

@christopherferreira9 christopherferreira9 added team-qa QA team no-changelog no-changelog Indicates no external facing user changes, therefore no changelog documentation needed labels May 7, 2026
@github-actions

github-actions Bot commented May 7, 2026

Copy link
Copy Markdown
Contributor

CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes.

@github-actions github-actions Bot added the size-S label May 7, 2026
@github-actions

github-actions Bot commented May 7, 2026

Copy link
Copy Markdown
Contributor

🔍 Smart E2E Test Selection

  • Selected E2E tags: SmokeConfirmations
  • Selected Performance tags: None (no tests recommended)
  • Risk Level: low
  • AI Confidence: 97%
click to see 🤖 AI reasoning details

E2E Test Selection:
The only changed file is tests/smoke/confirmations/send/metricsValidationHelper.ts, a test helper used exclusively by send-native-token.spec.ts (confirmed via grep). The change adds retry logic (up to 5 attempts with 1s delay) for finding the "Transaction Finalized" analytics event, making the test more resilient to timing issues. It also imports the EventPayload type for proper TypeScript typing. This is a pure test infrastructure improvement with no app code changes. The only test file that imports this helper is tagged SmokeConfirmations, so only that tag is needed. No performance impact since no app code was modified.

Performance Test Selection:
No app code was changed - only a test helper file was modified. No performance impact expected.

View GitHub Actions results

@sonarqubecloud

sonarqubecloud Bot commented May 7, 2026

Copy link
Copy Markdown

@christopherferreira9 christopherferreira9 added this pull request to the merge queue May 7, 2026
Merged via the queue into main with commit b1d52ef May 7, 2026
188 of 193 checks passed
@christopherferreira9 christopherferreira9 deleted the cferreira/add-retry-to-transaction-finalized branch May 7, 2026 14:34
@github-actions github-actions Bot locked and limited conversation to collaborators May 7, 2026
@metamaskbotv2 metamaskbotv2 Bot added the release-7.77.0 Issue or pull request that will be included in release 7.77.0 label May 7, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

no-changelog no-changelog Indicates no external facing user changes, therefore no changelog documentation needed release-7.77.0 Issue or pull request that will be included in release 7.77.0 size-S team-qa QA team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants