test: fix flaky test Settings Redirects to ENS domains when user inputs ENS into address bar#41396
Conversation
Builds ready [218cfd2]
⚡ Performance Benchmarks (Total: 🟢 17 pass · 🟡 1 warn · 🔴 0 fail)
🌐 Dapp Page Load BenchmarksCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs
|
Settings Redirects to ENS domains when user inputs ENS into address bar
|
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. |
|
Builds ready [a353c07]
⚡ Performance Benchmarks (Total: 🟢 18 pass · 🟡 0 warn · 🔴 0 fail)
🌐 Dapp Page Load BenchmarksCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs
|



Description
This test is flaky as sometimes we are not redirected to the ENS resolved page.
We tried to mitigate this by getting the getPersistedState, but that reads fixture data immediately. Instead we will now wait for the live controller state (via Redux) to confirm the ipfsGateway and useAddressBarEnsResolution settings are active. Which reflects the running controller state that has been synced to the UI after background init.
Changelog
CHANGELOG entry:
Related issues
Fixes:
Manual testing steps
Screenshots/Recordings
Before
After
Pre-merge author checklist
Pre-merge reviewer checklist
Note
Low Risk
Test-only change that adjusts a wait condition; no production logic or security-sensitive code is modified.
Overview
Fixes flakiness in the ENS address-bar redirect E2E by switching the readiness check from
window.stateHooks.getPersistedState()(fixture/IndexedDB) togetCleanAppState()(live Redux/controller state).The test now waits until both
metamask.ipfsGateway === 'dweb.link'andmetamask.useAddressBarEnsResolution === trueare active before attempting the ENS navigation/redirect assertion.Written by Cursor Bugbot for commit a353c07. This will update automatically on new commits. Configure here.