MetaMask / metamask-extension

:globe_with_meridians: :electric_plug: The MetaMask browser extension enables browsing Ethereum blockchain enabled websites
https://metamask.io
Other
11.89k stars 4.85k forks source link

Fix "Change assets changes to native currency when switch..." flaky tests #26368

Open hjetpoluru opened 1 month ago

hjetpoluru commented 1 month ago

https://app.circleci.com/pipelines/github/MetaMask/metamask-extension/95156/workflows/96250320-ca46-4db4-82d7-e2e32e2ef13d/jobs/3541594/tests

Below are my findings:-

I noticed that the test fails because it is unable to recognize the amount of 2.000042, as it currently shows as 2.00011828 in the Chrome browser. Upon further validation, I found that this issue occurs in previous commits dated between the end of July and August 1st. Additionally, there are no estimated gas fee mocks.

Upon tracking the file changes, I noticed comments by @seaona regarding the fix and the issue. PR - https://github.com/MetaMask/metamask-extension/pull/25220 Bug - https://github.com/MetaMask/metamask-extension/issues/25243

I reverted the changes and tested locally against both Chrome and Firefox browsers, and it was working. Use the below commands to execute in chrome browser yarn yarn build:test yarn test:e2e:single test/e2e/tests/transaction/change-assets.spec.js --browser=chrome --debug --leave-running

Use the below commands to execute in firefox browser yarn ENABLE_MV3=false yarn start:test ENABLE_MV3=false yarn test:e2e:single test/e2e/tests/transaction/change-assets.spec.js --browser=firefox

However, when I pushed the changes, I noticed that the test was failing in the Firefox browser.

hjetpoluru commented 2 weeks ago

This bug needs to be fixed https://github.com/MetaMask/metamask-extension/issues/25243 and hence closing this PR

hjetpoluru commented 2 weeks ago

Accidentally closed the issue instead of closing the PR.