-
Notifications
You must be signed in to change notification settings - Fork 5.4k
fix: flaky test Vault Corruption restores a backup that is missing its
meta property successfully
#36777
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
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. |
📊 Page Load Benchmark ResultsCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Results generated automatically by MetaMask CI |
Builds ready [cfc977a]
UI Startup Metrics (1225 ± 54 ms)
Bundle size diffs [🚀 Bundle size reduced!]
|
📊 Page Load Benchmark ResultsCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Results generated automatically by MetaMask CI |
Builds ready [e663508]
UI Startup Metrics (1205 ± 59 ms)
Bundle size diffs [🚀 Bundle size reduced!]
|
confirm: boolean; | ||
}) { | ||
// click the Recovery/Reset button | ||
const recoveryButton = await driver.findClickableElement( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
📊 Page Load Benchmark ResultsCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Results generated automatically by MetaMask CI |
Builds ready [402b139]
UI Startup Metrics (1232 ± 70 ms)
Bundle size diffs [🚀 Bundle size reduced!]
|
📊 Page Load Benchmark ResultsCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Results generated automatically by MetaMask CI |
Builds ready [f3874d9]
UI Startup Metrics (1249 ± 68 ms)
Bundle size diffs [🚀 Bundle size reduced!]
|
await prompt.accept(); | ||
await driver.switchToWindowWithTitle( | ||
WINDOW_TITLES.ExtensionInFullScreenView, | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we switch to the Extension page to make sure we are in the correct window, as sometimes the window is closed and re-opened, causing the error web view has been discarded
📊 Page Load Benchmark ResultsCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Results generated automatically by MetaMask CI |
Builds ready [e92bdae]
UI Startup Metrics (1240 ± 72 ms)
Bundle size diffs [🚀 Bundle size reduced!]
|
📊 Page Load Benchmark ResultsCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Results generated automatically by MetaMask CI |
Builds ready [ccbb5c6]
UI Startup Metrics (1253 ± 69 ms)
Bundle size diffs [🚀 Bundle size reduced!]
|
📊 Page Load Benchmark ResultsCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Results generated automatically by MetaMask CI |
Builds ready [b710796]
UI Startup Metrics (1276 ± 79 ms)
Bundle size diffs [🚀 Bundle size reduced!]
|
📊 Page Load Benchmark ResultsCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Results generated automatically by MetaMask CI |
Builds ready [1d139e3]
UI Startup Metrics (1228 ± 55 ms)
Bundle size diffs [🚀 Bundle size reduced!]
|
import LoginPage from '../../page-objects/pages/login-page'; | ||
|
||
describe('Vault Corruption', function () { | ||
this.timeout(120000); // This test is very long, so we need an unusually high timeout |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
📊 Page Load Benchmark ResultsCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Results generated automatically by MetaMask CI |
Builds ready [480ac88]
UI Startup Metrics (1276 ± 63 ms)
Bundle size diffs [🚀 Bundle size reduced!]
|
📊 Page Load Benchmark ResultsCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Results generated automatically by MetaMask CI |
Builds ready [50950b5]
UI Startup Metrics (1241 ± 66 ms)
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
// reload and check title as quickly a possible, forever | ||
{ interval: 0, timeout: Infinity }, | ||
// reload and check title as quickly a possible | ||
{ interval: 100, timeout: 10000 }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the Infinity
value here is just taken as null (see last log below), then passing interval 0 and timeout of null effectively means the condition will run only once

with this fix, the test is less prone to errors, as we are effectively waiting for the correct title, going to the home page, as many times as needed (until reaching 10 seconds):

await driver.waitUntil(
async () => {
await driver.navigate(PAGES.HOME, { waitForControllers: false });
const title = await driver.driver.getTitle();
// the browser will return an error message for our UI's HOME page until
// the extension has restarted
return title === WINDOW_TITLES.ExtensionInFullScreenView;
},
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, very nice fix !
Description
Investigation:
Ìnfinity
which results in a null value, making the function run only once, then that's prone to failures, as there's no more 'wait until', rather just run the func once. See here[Bug]: Restore Vault - Race condition where page is auto closed after confirming Restore #36916
Changelog
CHANGELOG entry:
Related issues
Fixes:
Manual testing steps
Screenshots/Recordings
Before
After
Pre-merge author checklist
Pre-merge reviewer checklist
Note
Stabilizes vault corruption E2E tests by increasing timeouts, refining wait/polling, and hardening recovery click/window handling to avoid race conditions and stale elements.
test/e2e/tests/vault-corruption/vault-corruption.spec.ts
):120000
ms.waitForVaultRestorePage
polling to{ interval: 100, timeout: 10000 }
.clickRecover
):driver.clickElement('#critical-error-button')
instead of finding then clicking.switchToWindowWithTitle
, fallbackopenNewPage
+navigate
), and assert#critical-error-button
is absent (avoid stale state checks).#critical-error-button
remains clickable.Written by Cursor Bugbot for commit 50950b5. This will update automatically on new commits. Configure here.