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

Flaky Test: "Request Queue SwitchChain -> WatchAsset should clear subsequent watchAsset after switching chain" #24596

Closed
9 tasks
chloeYue opened this issue May 20, 2024 · 0 comments · Fixed by #24674
Assignees
Labels
flaky tests release-11.18.0 Issue or pull request that will be included in release 11.18.0 team-extension-platform

Comments

@chloeYue
Copy link
Contributor

chloeYue commented May 20, 2024

What is this about?

Failure:
https://app.circleci.com/pipelines/github/MetaMask/metamask-extension/81128/workflows/1085f11b-e5d2-4b07-8417-12b03f96e723/jobs/2873806/tests

Error message
Screenshot 2024-05-20 at 09 36 02

Screenshot
Screenshot 2024-05-20 at 09 36 53

Scenario

No response

Design

No response

Technical Details

No response

Threat Modeling Framework

No response

Acceptance Criteria

No response

Stakeholder review needed before the work gets merged

  • Engineering (needed in most cases)
  • Design
  • Product
  • QA (automation tests are required to pass before merging PRs but not all changes are covered by automation tests - please review if QA is needed beyond automation tests)
  • Security
  • Legal
  • Marketing
  • Management (please specify)
  • Other (please specify)

References

No response

@seaona seaona self-assigned this May 21, 2024
seaona added a commit that referenced this issue May 21, 2024
… clear subsequent watchAsset after switching chain` (#24674)

## **Description**
This PR fixes the flaky test happening in Firefox browser. The problem
is a race condition in mostly firefox browser where whenever we trigger
2 requests in a queue (Switch Network and Watch Asset), we were seeing
the Watch Asset screen instead of the Switch Network screen. It used a
delay to mitigate this, but it was still not 100% effective. Now the
delay has been changed by a wait for condition.

It also refactors the spec, in order to skip several initial steps for
the test setup, by using fixtures:
- we can skip the Connect to Dapp steps, and instead use the
`.withPermissionControllerConnectedToTestDapp()` fixture
- we can skip the Create Token Contract steps, and instead use the
`smartContract` passed in fixtures

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

## **Related issues**

Fixes: #24596

## **Manual testing steps**

1. Check ci
2. Run test multiple times locally `yarn test:e2e:single
test/e2e/tests/request-queuing/switchChain-watchAsset.spec.js
--browser=firefox --leave-running=true --retry-until-failure
--retries=15`

## **Screenshots/Recordings**
Artifacts and logs from ci failure

![Screenshot 2024-05-20 at 09 36
02](https://github.com/MetaMask/metamask-extension/assets/105063779/0b4c715c-eea2-4953-940f-45f2fc15072c)

![Screenshot 2024-05-20 at 09 36
53](https://github.com/MetaMask/metamask-extension/assets/105063779/860185cc-22db-48ab-8765-3329d24b00b0)


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

## **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
- [x] I’ve included tests if applicable
- [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [x] 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.

---------

Co-authored-by: Harika Jetpoluru <153644847+hjetpoluru@users.noreply.github.com>
@metamaskbot metamaskbot added the release-11.18.0 Issue or pull request that will be included in release 11.18.0 label May 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
flaky tests release-11.18.0 Issue or pull request that will be included in release 11.18.0 team-extension-platform
Projects
None yet
3 participants