Skip to content
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

fix: Cherry-pick pr from develop to v11.16.0 to fix flaky test #24564

Merged
merged 6 commits into from
May 17, 2024

Conversation

hjetpoluru
Copy link
Contributor

@hjetpoluru hjetpoluru commented May 16, 2024

Description

Cherry PR's from develop to release v11.16.0 for flaky test fix

Open in GitHub Codespaces

danjm and others added 2 commits May 16, 2024 05:34
Updates the gas fee controller to v11.15.2, so that the gas fee
controller is instantiated with the proper metadata.

[![Open in GitHub
Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/24520?quickstart=1)

Fixes: #24383

1. Start a tx
2. Add recipient and amount
3. Check console, there should not be a `Error: No metadata found for
'nonRPCGasFeeApisDisabled'`

- [x] I’ve followed [MetaMask Coding
Standards](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/CODING_GUIDELINES.md).
- [x] I've completed the PR template to the best of my ability
- [ ] I’ve included tests if applicable
- [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [ ] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.

- [ ] 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.
@hjetpoluru hjetpoluru added team-extension-platform INVALID-PR-TEMPLATE PR's body doesn't match template labels May 16, 2024
@hjetpoluru hjetpoluru self-assigned this May 16, 2024
@hjetpoluru hjetpoluru requested review from a team as code owners May 16, 2024 14:26
Copy link
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.

@hjetpoluru hjetpoluru changed the title fix: Cherry pr for flaky test fix: Cherry-pick pr from develop to v11.16.0 to fix flaky test May 16, 2024
danjm and others added 4 commits May 17, 2024 05:45
## **Description**

` request-queueing/ui.spec.js` has been particularly flaky. In
particular, the problem was described as follows:

> The test stalls for 10+ seconds locally at detecting 4 windows:
> await driver.waitUntilXWindowHandles(numHandles)
> The test is doing exactly what it's meant to but the
waitUntilXWindowHandles call is taking an eternity

I noticed that this line in particular in the `waitUntilXWindowHandles`
helper method seemed to take a long time to resolve in only one case:
`windowHandles = await this.driver.getAllWindowHandles();`

So the problem seemed to be not with our `waitUntilXWindowHandles`
itself, but something related to selenium- webdriver's own
`getAllWindowHandles` method

From this stack overflow post, it seems that others have had trouble
with having `getAllWindowHandles` resolve when `executeScript` is not
resolved
https://stackoverflow.com/questions/64687179/calling-getwindowhandles-again-causing-timeout

So the attempted fix, which worked on three successive local runs, is to
properly await the executeScript that happens before the
`getAllWindowHandles` call in question. We also need to remove the
`return` from the script to be executed, so that webdriver-selenium is
not waiting for a returned promise to resolve.

[![Open in GitHub
Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/24440?quickstart=1)


## **Manual testing steps**

1. ` request-queueing/ui.spec.js` should pass in automated tests and not
be flaky


## **Pre-merge author checklist**

- [x] I’ve followed [MetaMask Coding
Standards](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/CODING_GUIDELINES.md).
- [x] I've completed the PR template to the best of my ability
- [ ] I’ve included tests if applicable
- [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [ ] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.

## **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.
The use of driver.navigate() in combination with the use of
driver.navigate() in unlockWallet helper function was causing the page
to reload in e2e tests. This is causing issues with filling in the
password when unlocking the wallet.
<img width="881" alt="image"
src="https://github.com/MetaMask/metamask-extension/assets/10986371/db981ad9-4705-46f1-ae80-30456706e952">
I suspect the test was trying to access DOM elements created before the
re-rendering.
<!--
Please submit this PR as a draft initially.
Do not mark it as "Ready for review" until the template has been
completely filled out, and PR status checks have passed at least once.
-->

<!--
Write a short description of the changes included in this pull request,
also include relevant motivation and context. Have in mind the following
questions:
1. What is the reason for the change?
2. What is the improvement/solution?
-->

[![Open in GitHub
Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/24436?quickstart=1)

Fixes:

1. Go to this page...
2.
3.

<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->

<!-- [screenshots/recordings] -->

<!-- [screenshots/recordings] -->

- [ ] I’ve followed [MetaMask Coding
Standards](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/CODING_GUIDELINES.md).
- [ ] I've completed the PR template to the best of my ability
- [ ] I’ve included tests if applicable
- [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [ ] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.

- [ ] 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.
…1.15.0

The version bump changes in #24306 were previously cherry-picked to v11.14.5, but the test changes were not, as they were not needed on that branch, as the gas feel controller wasn't actually updated on that branch. Now that v11.16.0 is using the latest gas-fee-controller, we need the sentry and snapshot changes
Copy link

🚨 Potential security issues detected. Learn more about Socket for GitHub ↗︎

To accept the risk, merge this PR and you will not be notified again.

Alert Package NoteSource
No contributors or author data npm/@metamask/snaps-utils@7.2.0

View full report↗︎

Next steps

Why is contributor and author data important?

Package does not specify a list of contributors or an author in package.json.

Add a author field or contributors array to package.json.

Take a deeper look at the dependency

Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support [AT] socket [DOT] dev.

Remove the package

If you happen to install a dependency that Socket reports as Known Malware you should immediately remove it and select a different dependency. For other alert types, you may may wish to investigate alternative packages or consider if there are other ways to mitigate the specific risk posed by the dependency.

Mark a package as acceptable risk

To ignore an alert, reply with a comment starting with @SocketSecurity ignore followed by a space separated list of ecosystem/package-name@version specifiers. e.g. @SocketSecurity ignore npm/foo@1.0.0 or ignore all packages with @SocketSecurity ignore-all

  • @SocketSecurity ignore npm/@metamask/snaps-utils@7.2.0

@danjm danjm merged commit 30ae822 into Version-v11.16.0 May 17, 2024
60 of 62 checks passed
@danjm danjm deleted the cherry-pr-flaky-test branch May 17, 2024 14:04
@github-actions github-actions bot locked and limited conversation to collaborators May 17, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
INVALID-PR-TEMPLATE PR's body doesn't match template team-extension-platform
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants