Skip to content

fix(benchmarks): log iteration start and failure in runBenchmarkWithIterations - #45432

Open
MajorLift wants to merge 1 commit into
mainfrom
jongsun/ci/benchmark-iteration-logging
Open

fix(benchmarks): log iteration start and failure in runBenchmarkWithIterations#45432
MajorLift wants to merge 1 commit into
mainfrom
jongsun/ci/benchmark-iteration-logging

Conversation

@MajorLift

@MajorLift MajorLift commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Changelog

CHANGELOG entry: null

Description

runBenchmarkWithIterations emits output only on success. A failed iteration increments failedRuns and returns silently; a hanging iteration emits nothing at all. So a run that stalled, a run whose iterations all failed, and a run that stopped after the first iteration are indistinguishable in a CI log.

This is blocking attribution on chrome-webpack-userJourneyTransactions, cancelled at its 30-minute timeout in 11 of the last 12 main runs. In run 31423339197 the log carries one iteration's report at 19:25:26 and then 31 minutes of nothing before cancellation at 19:56:07. Whether iteration 2 started cannot be recovered from what is emitted today.

This commit adds an iteration-start line before each iteration and a failure line carrying result.error.

Verification

runBenchmarkWithIterations had no unit coverage; the three tests added here are the first. Both arms were run:

with the change      PASS   7 passed, 7 total
runner.ts at base    FAIL   3 failed, 4 passed, 7 total

The three failures on base are exactly the three new tests, and the four pre-existing tests pass in both arms.

This does not fix the stall, and does not claim to — the stall does not reproduce on demand, so no test here exercises it. The three cases in test/e2e/benchmarks/utils/runner.test.ts cover exactly one property: an iteration that previously emitted nothing now emits a line, in the success, failure and never-returns cases.

Not in this PR

The linked issue also covers two adjacent gaps in the same area, deliberately left out to keep this reviewable: the S3 key omits run_attempt so re-runs overwrite their own objects, and send-to-sentry.ts sets no run or attempt identifier. Both are one-line additions and can follow.

Related issues

Fixes: #45431

Manual testing steps

  1. yarn jest test/e2e/benchmarks/utils/runner.test.ts
  2. On the next main run, confirm chrome-webpack-userJourneyTransactions logs iteration 2/5 started before the silent period.

Pre-merge author checklist


Note

Low Risk
Adds console logging and unit tests only; does not change benchmark execution, retries, or result aggregation.

Overview
Makes stalled or failed benchmark iterations attributable in CI logs. Previously runBenchmarkWithIterations only logged on success, so a hang looked identical to an iteration that never started.

Adds a start log before each iteration and a failure log with result.error. Includes unit tests covering start announcements, failed iterations, and attributing a hang to the iteration that began but never finished.

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

The loop reported only on success, so a failed iteration incremented
`failedRuns` silently and a hanging one emitted nothing at all. A stalled run,
a run whose iterations all failed, and a run that stopped after the first were
identical in a CI log.

That is currently blocking attribution on chrome-webpack-userJourneyTransactions,
where run 31423339197 carries one iteration's report and then 31 minutes of
silence before cancellation, with no way to tell whether iteration 2 began.

`runBenchmarkWithIterations` had no unit coverage; the three tests added here
are the first. Verified both arms: 7 passed with the change, and 3 of those 7
fail with runner.ts at base while the four pre-existing tests are unaffected.
@MajorLift
MajorLift deployed to pr-comment August 11, 2026 21:18 — with GitHub Actions Active
@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.

@metamask-ci metamask-ci Bot added team-extension-platform Extension Platform team INVALID-PR-TEMPLATE PR's body doesn't match template labels Aug 11, 2026
@MajorLift
MajorLift deployed to pr-comment August 11, 2026 21:19 — with GitHub Actions Active
@metamask-ci

metamask-ci Bot commented Aug 11, 2026

Copy link
Copy Markdown
Contributor
Builds ready [78e465d] [reused from 5fa8bb1]
⚡ Performance Benchmarks (Total: 🟢 7 pass · 🟡 10 warn · 🔴 4 fail)

Baseline (latest main): 171ed20 | Date: 7/28/2026 | Pipeline: 31537257294 | Baseline logs

Metricschrome-webpackfirefox-webpack
onboardingImportWallet
[Sentry log · main/release]
🔴 srpButtonToSrpForm(p95) [CI log]🔴 [CI log]
onboardingNewWallet
[Sentry log · main/release]
🔴 agreeButtonToOnboardingSuccess(p95) [CI log]🔴 [CI log]

Regressions (🔴 4 failures)

Interaction Benchmarks · Samples: 5
Benchmarkchrome-webpackfirefox-webpack
loadNewAccount
[Sentry log · main/release]
🟡 [CI log]
🟡 load_new_account
🟡 [CI log]
🟡 load_new_account
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/load_new_account: +18%
  • loadNewAccount/total: +18%
  • confirmTx/longTaskTotalDuration: -13%
  • confirmTx/longTaskMaxDuration: +37%
  • confirmTx/tbt: -23%
  • bridgeUserActions/bridge_load_asset_picker: +99%
  • bridgeUserActions/longTaskCount: +11%
  • bridgeUserActions/longTaskTotalDuration: +16%
  • bridgeUserActions/longTaskMaxDuration: +11%
  • bridgeUserActions/tbt: +30%
  • bridgeUserActions/total: +12%
  • bridgeUserActions/inp: +15%
  • loadNewAccount/load_new_account: +22%
  • loadNewAccount/total: +22%
  • loadNewAccount/inp: +14%
  • loadNewAccount/fcp: -48%
  • loadNewAccount/lcp: +1114%
  • confirmTx/confirm_tx: +10%
  • confirmTx/longTaskCount: -100%
  • confirmTx/longTaskTotalDuration: -100%
  • confirmTx/longTaskMaxDuration: -100%
  • confirmTx/tbt: -100%
  • confirmTx/total: +10%
  • confirmTx/inp: -24%
  • confirmTx/lcp: +1200%
  • bridgeUserActions/bridge_load_page: +190%
  • bridgeUserActions/bridge_load_asset_picker: +69%
  • bridgeUserActions/longTaskCount: -100%
  • bridgeUserActions/longTaskTotalDuration: -100%
  • bridgeUserActions/longTaskMaxDuration: -100%
  • bridgeUserActions/tbt: -100%
  • bridgeUserActions/total: +23%
  • bridgeUserActions/inp: +15%
  • bridgeUserActions/fcp: -45%
  • bridgeUserActions/lcp: +1195%

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

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

📈 Results compared to the previous 5 runs on main

  • startupStandardHome/firstReactRender: -99%
  • startupStandardHome/numNetworkReqs: -14%
  • startupStandardHome/domInteractive: +45%
  • startupStandardHome/backgroundConnect: +19%
  • startupStandardHome/firstReactRender: -98%
  • startupStandardHome/setupStore: +24%
  • startupStandardHome/numNetworkReqs: -13%
  • startupStandardHome/fcp: +50%
  • startupStandardHome/lcp: +13%
  • startupPowerUserHome/uiStartup: -21%
  • startupPowerUserHome/load: -13%
  • startupPowerUserHome/domContentLoaded: -13%
  • startupPowerUserHome/domInteractive: -11%
  • startupPowerUserHome/firstReactRender: -99%
  • startupPowerUserHome/initialActions: +11%
  • startupPowerUserHome/loadScripts: -14%
  • startupPowerUserHome/setupStore: +181%
  • startupPowerUserHome/numNetworkReqs: +12%
  • startupPowerUserHome/inp: -28%
  • startupPowerUserHome/lcp: -10%

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

  • 🟡 startupPowerUserHome/LCP: p75 2.6s
User Journey Benchmarks · Samples: 5 · mock API 🔴 4

⚠️ Missing data: chrome/webpack/userJourneyTransactions

Benchmarkchrome-webpackfirefox-webpack
onboardingImportWallet
[Sentry log · main/release]
🔴 [CI log]
🔴 doneButtonToHomeScreen
🔴 total
🔴 [CI log]
🔴 total
onboardingNewWallet
[Sentry log · main/release]
🔴 [CI log]
🔴 total
🔴 [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]
swap
[Sentry log · main/release]
🟢 [CI log]

📈 Results compared to the previous 5 runs on main

  • onboardingImportWallet/srpButtonToSrpForm: +14%
  • onboardingImportWallet/metricsToWalletReadyScreen: -33%
  • onboardingImportWallet/doneButtonToHomeScreen: +33%
  • onboardingImportWallet/openAccountMenuToAccountListLoaded: +82%
  • onboardingImportWallet/longTaskCount: +57%
  • onboardingImportWallet/longTaskTotalDuration: +12%
  • onboardingImportWallet/total: +29%
  • onboardingNewWallet/agreeButtonToOnboardingSuccess: +31%
  • onboardingNewWallet/doneButtonToAssetList: +17%
  • onboardingNewWallet/longTaskCount: +25%
  • onboardingNewWallet/longTaskTotalDuration: +58%
  • onboardingNewWallet/tbt: +36%
  • onboardingNewWallet/total: +17%
  • solanaAssetDetails/assetClickToPriceChart: +264%
  • solanaAssetDetails/longTaskCount: -100%
  • solanaAssetDetails/longTaskTotalDuration: -100%
  • solanaAssetDetails/longTaskMaxDuration: -100%
  • solanaAssetDetails/tbt: -100%
  • solanaAssetDetails/total: +264%
  • solanaAssetDetails/inp: +11%
  • solanaAssetDetails/fcp: +20%
  • importSrpHome/homeAfterImportWithNewWallet: +26%
  • importSrpHome/longTaskCount: +34%
  • importSrpHome/longTaskTotalDuration: +17%
  • importSrpHome/longTaskMaxDuration: -27%
  • importSrpHome/total: +24%
  • importSrpHome/fcp: +12%

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

  • 🟡 assetDetails/FCP: p75 1.9s
  • 🟡 solanaAssetDetails/FCP: p75 1.9s
  • 🟡 importSrpHome/INP: p75 304ms
  • 🟡 importSrpHome/FCP: p75 1.9s
  • 🟡 assetDetails/FCP: p75 1.9s
  • 🟡 assetDetails/LCP: p75 2.7s
  • 🟡 solanaAssetDetails/FCP: p75 2.1s
  • 🟡 solanaAssetDetails/LCP: p75 2.7s
Dapp Page Load Benchmarks · Samples: 100

⚠️ Missing data: chrome/webpack/pageLoadBenchmark

✅ No regressions detected

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%)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

INVALID-PR-TEMPLATE PR's body doesn't match template risk:low size-S team-extension-platform Extension Platform team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[P2] Benchmark runs are not observable: iteration failures emit nothing, re-runs overwrite their own data

1 participant