Skip to content

fix(e2e): globalize non-EVM snap discovery mocks#43818

Merged
DDDDDanica merged 3 commits into
mainfrom
copilot/fix-e2e-icon-render-timeout
Jun 26, 2026
Merged

fix(e2e): globalize non-EVM snap discovery mocks#43818
DDDDDanica merged 3 commits into
mainfrom
copilot/fix-e2e-icon-render-timeout

Conversation

Copilot AI commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

Description

Non-EVM (Solana/Bitcoin) snap account icons render at the edge of the default 10s E2E wait because the snaps' discovery requests were not part of the shared mock set. Those requests fell through the global empty-200 catch-all in mock-e2e.js, so the Bitcoin BDK esplora full_scan and Solana getSignaturesForAddress calls failed and the providers retried — a deterministic ~9s storm (2s timeout × 3 attempts with doubling backoff) that lands right at the 10s wait and makes multichain/login specs borderline-flaky on constrained CI.

Why: the discovery network calls had no shared default mocks — only test-local ones (test/e2e/tests/btc/mocks/esplora.ts) — so any spec that rendered non-EVM accounts without wiring them hit the catch-all and stretched icon render into the retry budget.

What changed:

  • Shared Bitcoin discovery mocks added to test/e2e/mock-e2e.js (returning valid empty-scan responses): esplora/blocks, esplora/blocks/tip/height, esplora/blocks/tip/hash, esplora/scripthash/*/txs, esplora/scripthash/*/utxo, esplora/fee-estimates.
  • Shared Solana discovery mock for getSignaturesForAddress (returns an empty signature list).
  • These are registered as persistent defaults in the E2E setup, so multichain flows no longer depend on per-spec mock wiring. With discovery mocked, it resolves in milliseconds instead of the ~9s retry storm, so the icons render well within the default 10s wait.
  • Teststest/e2e/helpers/mock-e2e.test.js asserts both the handler shape and that the rules register as persistent defaults.

Scope: addresses the primary mock-coverage gap in the shared E2E environment. It does not change provider timeout policy or snap-executor cold-start behavior (tracked as the secondary follow-up in #43817).

Related issues

Fixes #43817

Related:

Manual testing steps

  1. yarn jest test/e2e/helpers/mock-e2e.test.js — the shared mock registrations pass.
  2. On a 2-core-class runner, run a multichain/login spec that renders Solana + Bitcoin icons (e.g. test/e2e/tests/multichain-accounts/*) and confirm waitForNonEvmAccountsLoaded passes reliably at the default 10s wait, with no [Solana]/[Bitcoin] Timed out after: 3000ms provider-retry lines in the logs.

Screenshots/Recordings

N/A — E2E test infrastructure only; no user-facing change.

Before

Bitcoin/Solana discovery requests fall through to the empty-200 catch-all → provider retries → icon render ≈10s (borderline-flaky at the default wait).

After

Discovery resolves from shared default mocks in milliseconds → icons render well within the default 10s wait.

Pre-merge author checklist

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
E2E mock infrastructure only; no production runtime, auth, or user-facing behavior changes.

Overview
Adds shared default network mocks in mock-e2e.js so Bitcoin and Solana snap discovery calls no longer hit the generic empty-200 catch-all (which triggered ~9s provider retries and flaky multichain icon waits).

setupDefaultNonEvmDiscoveryMocks registers persistent .always() handlers for Bitcoin Infura esplora paths (blocks, tip height/hash, scripthash txs/utxo, fee-estimates) with realistic empty-scan payloads, and for Solana getSignaturesForAddress (empty result). It runs from setupMocking after snap registry mocks so all E2E specs get coverage without per-test wiring.

New mock-e2e.test.js uses a Mockttp-style stub to assert rule registration, .always(), and response shapes for the main Bitcoin and Solana discovery endpoints.

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

Copilot AI changed the title [WIP] Fix E2E timeout for non-EVM icon rendering fix(e2e): globalize non-EVM snap discovery mocks Jun 23, 2026
Copilot AI requested a review from MajorLift June 23, 2026 22:16
@mm-token-exchange-service

Copy link
Copy Markdown

✨ Files requiring CODEOWNER review ✨

🧪 @MetaMask/qa (1 files, +118 -0)
  • 📁 test/
    • 📁 e2e/
      • 📄 mock-e2e.js +118 -0

@mm-token-exchange-service

Copy link
Copy Markdown
Builds ready [15075a9] [reused from c4b43e9]
Deprecated Browserify fallback builds
⚡ Performance Benchmarks (Total: 🟢 14 pass · 🟡 8 warn · 🔴 3 fail)

Baseline (latest main): c4b43e9 | Date: 6/23/2026 | Pipeline: 28060816812 | Baseline logs

Metricschrome-webpackfirefox-webpack
onboardingImportWallet
[Sentry log · main/release]
🔴 openAccountMenuToAccountListLoaded(p75) [CI log]🔴 [CI log]
onboardingNewWallet
[Sentry log · main/release]
🟢 [CI log]🔴 [CI log]

Regressions (🔴 3 failures)

Interaction Benchmarks · Samples: 5
Benchmarkchrome-webpackfirefox-webpack
loadNewAccount
[Sentry log · main/release]
🟢 [CI log]🟢 [CI log]
confirmTx
[Sentry log · main/release]
🟢 [CI log]🟡 [CI log]
bridgeUserActions
[Sentry log · main/release]
🟢 [CI log]🟡 [CI log]

📈 Results compared to the previous 5 runs on main

  • loadNewAccount/inp: +19%
  • bridgeUserActions/bridge_load_page: -10%
  • bridgeUserActions/longTaskMaxDuration: -10%
  • bridgeUserActions/tbt: -26%
  • loadNewAccount/inp: -25%
  • loadNewAccount/fcp: -52%
  • loadNewAccount/lcp: +1096%
  • confirmTx/confirm_tx: +11%
  • confirmTx/longTaskCount: -100%
  • confirmTx/longTaskTotalDuration: -100%
  • confirmTx/longTaskMaxDuration: -100%
  • confirmTx/tbt: -100%
  • confirmTx/total: +11%
  • confirmTx/lcp: +1102%
  • bridgeUserActions/bridge_load_page: +196%
  • bridgeUserActions/bridge_load_asset_picker: +19%
  • bridgeUserActions/longTaskCount: -100%
  • bridgeUserActions/longTaskTotalDuration: -100%
  • bridgeUserActions/longTaskMaxDuration: -100%
  • bridgeUserActions/tbt: -100%
  • bridgeUserActions/total: +15%
  • bridgeUserActions/inp: -12%
  • bridgeUserActions/lcp: +1171%

🌐 Core Web Vitals — 🟢 good · 🟡 needs improvement · 🔴 poor (web.dev thresholds)

  • 🟡 confirmTx/FCP: p75 1.8s
  • 🟡 bridgeUserActions/FCP: p75 1.8s
Startup Benchmarks · Samples: 100
Benchmarkchrome-webpackfirefox-webpack
startupStandardHome
[Sentry log · main/release]
🟢 [CI log]🟢 [CI log]
startupPowerUserHome
[Sentry log · main/release]
🟡 [CI log]🟡 [CI log]

📈 Results compared to the previous 5 runs on main

  • startupPowerUserHome/domInteractive: +12%
  • startupPowerUserHome/firstReactRender: +10%
  • startupPowerUserHome/initialActions: +23%
  • startupPowerUserHome/setupStore: +17%
  • startupPowerUserHome/longTaskTotalDuration: +10%
  • startupPowerUserHome/tbt: +10%
  • startupPowerUserHome/inp: +10%
  • startupPowerUserHome/uiStartup: +16%
  • startupPowerUserHome/load: +13%
  • startupPowerUserHome/domContentLoaded: +13%
  • startupPowerUserHome/domInteractive: +20%
  • startupPowerUserHome/backgroundConnect: -16%
  • startupPowerUserHome/firstReactRender: +15%
  • startupPowerUserHome/loadScripts: +16%
  • startupPowerUserHome/setupStore: +15%
  • startupPowerUserHome/fcp: +11%
  • startupPowerUserHome/lcp: +15%

🌐 Core Web Vitals — 🟢 good · 🟡 needs improvement · 🔴 poor (web.dev thresholds)

  • 🔴 startupPowerUserHome/INP: p75 560ms
  • 🟡 startupPowerUserHome/LCP: p75 3.8s
User Journey Benchmarks · Samples: 5 · mock API 🔴 3
Benchmarkchrome-webpackfirefox-webpack
onboardingImportWallet
[Sentry log · main/release]
🔴 [CI log]
🟡 doneButtonToHomeScreen
🔴 total
🔴 [CI log]
🔴 total
onboardingNewWallet
[Sentry log · main/release]
🟢 [CI log]🔴 [CI log]
🔴 total
assetDetails
[Sentry log · main/release]
🟢 [CI log]🟢 [CI log]
solanaAssetDetails
[Sentry log · main/release]
🟢 [CI log]🟢 [CI log]
importSrpHome
[Sentry log · main/release]
🟡 [CI log]🟡 [CI log]
sendTransactions
[Sentry log · main/release]
🟡 [CI log]🟢 [CI log]
swap
[Sentry log · main/release]
🟡 [CI log]🟢 [CI log]

📈 Results compared to the previous 5 runs on main

  • onboardingImportWallet/metricsToWalletReadyScreen: -12%
  • onboardingImportWallet/doneButtonToHomeScreen: -11%
  • onboardingImportWallet/openAccountMenuToAccountListLoaded: +12%
  • onboardingImportWallet/longTaskTotalDuration: +22%
  • onboardingImportWallet/longTaskMaxDuration: +18%
  • onboardingImportWallet/tbt: +21%
  • onboardingNewWallet/doneButtonToAssetList: -11%
  • onboardingNewWallet/longTaskCount: -17%
  • solanaAssetDetails/assetClickToPriceChart: +28%
  • solanaAssetDetails/total: +28%
  • solanaAssetDetails/inp: +19%
  • solanaAssetDetails/cls: +12%
  • importSrpHome/cls: -35%
  • sendTransactions/selectTokenToSendFormLoaded: +13%
  • sendTransactions/reviewTransactionToConfirmationPage: -44%
  • sendTransactions/longTaskCount: -44%
  • sendTransactions/longTaskTotalDuration: -19%
  • sendTransactions/tbt: -76%
  • sendTransactions/total: -44%
  • sendTransactions/inp: +11%
  • sendTransactions/lcp: +20%
  • sendTransactions/cls: -67%
  • swap/tbt: +19%
  • swap/cls: -14%

🌐 Core Web Vitals — 🟢 good · 🟡 needs improvement · 🔴 poor (web.dev thresholds)

  • 🟡 importSrpHome/INP: p75 264ms
  • 🟡 sendTransactions/INP: p75 216ms
  • 🟡 sendTransactions/FCP: p75 1.8s
  • 🟡 swap/FCP: p75 1.8s
  • 🟡 importSrpHome/FCP: p75 2.0s
Dapp Page Load Benchmarks · Samples: 100
Benchmarkchrome-webpack
dappPageLoad
[Sentry log · main/release]
🟢 [CI log]

📈 Results compared to the previous 5 runs on main

  • dappPageLoad/pageLoadTime: +11%
Bundle size diffs
  • background: 0 Bytes (0%)
  • ui: 0 Bytes (0%)
  • common: 0 Bytes (0%)
  • other: 0 Bytes (0%)
  • contentScripts: 0 Bytes (0%)
  • zip: 0 Bytes (0%)

@MajorLift MajorLift added the team-extension-platform Extension Platform team label Jun 24, 2026
@github-actions

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.

@sonarqubecloud

Copy link
Copy Markdown

@mm-token-exchange-service

Copy link
Copy Markdown
Builds ready [99f989a]
Deprecated Browserify fallback builds
⚡ Performance Benchmarks (Total: 🟢 14 pass · 🟡 10 warn · 🔴 1 fail)

Baseline (latest main): 7534d77 | Date: 6/24/2026 | Pipeline: 28101401336 | Baseline logs

Metricschrome-webpackfirefox-webpack
onboardingNewWallet
[Sentry log · main/release]
🟢 [CI log]🔴 [CI log]

Regressions (🔴 1 failure)

Interaction Benchmarks · Samples: 5
Benchmarkchrome-webpackfirefox-webpack
loadNewAccount
[Sentry log · main/release]
🟢 [CI log]🟡 [CI log]
confirmTx
[Sentry log · main/release]
🟢 [CI log]🟡 [CI log]
bridgeUserActions
[Sentry log · main/release]
🟢 [CI log]🟢 [CI log]

📈 Results compared to the previous 5 runs on main

  • loadNewAccount/inp: +21%
  • loadNewAccount/lcp: -65%
  • bridgeUserActions/longTaskCount: +43%
  • bridgeUserActions/longTaskTotalDuration: +16%
  • bridgeUserActions/longTaskMaxDuration: -17%
  • bridgeUserActions/tbt: -48%
  • loadNewAccount/load_new_account: +50%
  • loadNewAccount/total: +50%
  • loadNewAccount/inp: -14%
  • loadNewAccount/lcp: +323%
  • confirmTx/confirm_tx: +11%
  • confirmTx/longTaskCount: -100%
  • confirmTx/longTaskTotalDuration: -100%
  • confirmTx/longTaskMaxDuration: -100%
  • confirmTx/tbt: -100%
  • confirmTx/total: +11%
  • confirmTx/lcp: +1138%
  • bridgeUserActions/bridge_load_page: +150%
  • bridgeUserActions/bridge_load_asset_picker: +49%
  • bridgeUserActions/longTaskCount: -100%
  • bridgeUserActions/longTaskTotalDuration: -100%
  • bridgeUserActions/longTaskMaxDuration: -100%
  • bridgeUserActions/tbt: -100%
  • bridgeUserActions/total: +19%
  • bridgeUserActions/inp: -10%
  • bridgeUserActions/lcp: +1166%

🌐 Core Web Vitals — 🟢 good · 🟡 needs improvement · 🔴 poor (web.dev thresholds)

  • 🟡 loadNewAccount/FCP: p75 1.8s
  • 🟡 confirmTx/FCP: p75 1.8s
Startup Benchmarks · Samples: 100
Benchmarkchrome-webpackfirefox-webpack
startupStandardHome
[Sentry log · main/release]
🟢 [CI log]🟢 [CI log]
startupPowerUserHome
[Sentry log · main/release]
🟡 [CI log]🟡 [CI log]

📈 Results compared to the previous 5 runs on main

  • startupStandardHome/firstReactRender: +14%
  • startupStandardHome/numNetworkReqs: -16%
  • startupStandardHome/lcp: -34%
  • startupStandardHome/uiStartup: -37%
  • startupStandardHome/load: -38%
  • startupStandardHome/domContentLoaded: -37%
  • startupStandardHome/domInteractive: -46%
  • startupStandardHome/backgroundConnect: -30%
  • startupStandardHome/firstReactRender: -39%
  • startupStandardHome/initialActions: -44%
  • startupStandardHome/loadScripts: -38%
  • startupStandardHome/setupStore: -28%
  • startupStandardHome/numNetworkReqs: +16%
  • startupStandardHome/fcp: -44%
  • startupStandardHome/lcp: -36%
  • startupPowerUserHome/backgroundConnect: -19%
  • startupPowerUserHome/inp: +23%

🌐 Core Web Vitals — 🟢 good · 🟡 needs improvement · 🔴 poor (web.dev thresholds)

  • 🔴 startupPowerUserHome/INP: p75 552ms
  • 🟡 startupPowerUserHome/INP: p75 256ms
  • 🟡 startupPowerUserHome/LCP: p75 3.5s
User Journey Benchmarks · Samples: 5 · mock API 🔴 1
Benchmarkchrome-webpackfirefox-webpack
onboardingImportWallet
[Sentry log · main/release]
🟢 [CI log]🟢 [CI log]
onboardingNewWallet
[Sentry log · main/release]
🟢 [CI log]🔴 [CI log]
🔴 total
assetDetails
[Sentry log · main/release]
🟢 [CI log]🟡 [CI log]
solanaAssetDetails
[Sentry log · main/release]
🟢 [CI log]🟡 [CI log]
importSrpHome
[Sentry log · main/release]
🟡 [CI log]🟡 [CI log]
sendTransactions
[Sentry log · main/release]
🟡 [CI log]🟡 [CI log]
swap
[Sentry log · main/release]
🟢 [CI log]🟢 [CI log]

📈 Results compared to the previous 5 runs on main

  • onboardingImportWallet/metricsToWalletReadyScreen: -32%
  • onboardingImportWallet/doneButtonToHomeScreen: -79%
  • onboardingImportWallet/openAccountMenuToAccountListLoaded: -99%
  • onboardingImportWallet/longTaskCount: -47%
  • onboardingImportWallet/longTaskTotalDuration: -84%
  • onboardingImportWallet/longTaskMaxDuration: -85%
  • onboardingImportWallet/tbt: -97%
  • onboardingImportWallet/total: -82%
  • onboardingNewWallet/doneButtonToAssetList: -11%
  • onboardingNewWallet/longTaskCount: -17%
  • onboardingNewWallet/longTaskTotalDuration: -63%
  • onboardingNewWallet/longTaskMaxDuration: -34%
  • onboardingNewWallet/tbt: -71%
  • solanaAssetDetails/assetClickToPriceChart: -48%
  • solanaAssetDetails/total: -48%
  • solanaAssetDetails/cls: +33%
  • importSrpHome/loginToHomeScreen: -20%
  • importSrpHome/openAccountMenuAfterLogin: +21%
  • importSrpHome/homeAfterImportWithNewWallet: -39%
  • importSrpHome/longTaskCount: -25%
  • importSrpHome/longTaskTotalDuration: -39%
  • importSrpHome/longTaskMaxDuration: -11%
  • importSrpHome/tbt: -44%
  • importSrpHome/total: -35%
  • importSrpHome/inp: -22%
  • importSrpHome/cls: -74%
  • sendTransactions/openSendPageFromHome: +38%
  • sendTransactions/longTaskCount: -100%
  • sendTransactions/longTaskTotalDuration: -100%
  • sendTransactions/longTaskMaxDuration: -100%
  • sendTransactions/tbt: -100%
  • sendTransactions/inp: -26%
  • sendTransactions/cls: -91%

🌐 Core Web Vitals — 🟢 good · 🟡 needs improvement · 🔴 poor (web.dev thresholds)

  • 🟡 importSrpHome/INP: p75 208ms
  • 🟡 sendTransactions/FCP: p75 1.8s
  • 🟡 assetDetails/FCP: p75 1.8s
  • 🟡 solanaAssetDetails/FCP: p75 1.9s
  • 🟡 importSrpHome/FCP: p75 1.9s
  • 🟡 sendTransactions/FCP: p75 1.8s
Dapp Page Load Benchmarks · Samples: 100
Benchmarkchrome-webpack
dappPageLoad
[Sentry log · main/release]
🟢 [CI log]

📈 Results compared to the previous 5 runs on main

  • dappPageLoad/pageLoadTime: -18%
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 2.12 KiB (0.02%)
  • ui: 4.47 KiB (0.03%)
  • common: 0 Bytes (0%)
  • other: 0 Bytes (0%)
  • contentScripts: -396 Bytes (-0.02%)
  • zip: 1.28 KiB (0%)

@MajorLift MajorLift marked this pull request as ready for review June 26, 2026 10:12
@MajorLift MajorLift requested a review from a team as a code owner June 26, 2026 10:12
@MajorLift MajorLift requested a review from Copilot June 26, 2026 10:12

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR improves the shared E2E mocking layer so non‑EVM snap discovery network calls (Bitcoin esplora + Solana getSignaturesForAddress) no longer fall through the generic empty-200 catch-all, avoiding deterministic provider retry delays that made non‑EVM account icon rendering borderline-flaky in multichain flows.

Changes:

  • Added persistent default mocks in test/e2e/mock-e2e.js for key Bitcoin esplora discovery endpoints and Solana getSignaturesForAddress.
  • Wired the new default non‑EVM discovery mocks into the shared setupMocking flow.
  • Added a Jest unit test that validates the new handlers are registered as persistent defaults and return the expected “empty scan” shapes.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
test/e2e/mock-e2e.js Adds and registers persistent default Bitcoin/Solana discovery mocks to prevent slow retries in shared E2E runs.
test/e2e/helpers/mock-e2e.test.js Adds unit coverage asserting the new discovery mock rules exist, are persistent (.always()), and return expected payload shapes.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@seaona seaona left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

very nice finding! I've noticed we only add Bitcoin and Solana. Do we also need to add Tron?

@DDDDDanica DDDDDanica added this pull request to the merge queue Jun 26, 2026
Merged via the queue into main with commit 8bdc82d Jun 26, 2026
212 checks passed
@DDDDDanica DDDDDanica deleted the copilot/fix-e2e-icon-render-timeout branch June 26, 2026 14:55
@github-actions github-actions Bot locked and limited conversation to collaborators Jun 26, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

E2E: globalize snap discovery mocks — non-EVM (Solana/Bitcoin) icons take ~10s to render on 2-core CI (provider retry storm)

5 participants