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: "Create token, approve token and approve token without gas approves an already created token and displays the token approval data @no-mmi" #24643

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

Comments

@chloeYue
Copy link
Contributor

What is this about?

Failure:
https://app.circleci.com/pipelines/github/MetaMask/metamask-extension/81107/workflows/aab906f8-10b6-43ab-910c-480e19835089/jobs/2872682/tests

Error message
Screenshot 2024-05-20 at 17 31 23

Screenshot
Screenshot 2024-05-20 at 17 31 13

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

@DDDDDanica DDDDDanica self-assigned this May 31, 2024
DDDDDanica added a commit that referenced this issue Jun 5, 2024
…token without gas approves an already created token and displays the token approval data @no-mmi" (#24998)

<!--
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.
-->

## **Description**
The cause of this flaky tests is unclosed dialog after txn approval.
When i put some logs in between flow, it is noticeable that clicking
approval button will result in triggering the txn and redirect to
previous page
```
    dispatch(updateAndApproveTx(customNonceMerge(fullTxData))).then(() => {
      dispatch(clearConfirmTransaction());
      history.push(mostRecentOverviewPage);
    });
```

However, the dialog is still visible and txn is not completely finished
when we decided to move to expanded extension view to validate activity
`await driver.switchToWindow(extension);`
<img width="1153" alt="截屏2024-06-02 22 34 16"
src="https://github.com/MetaMask/metamask-extension/assets/12678455/b7bd1caa-7ee0-48f2-a936-99ac42c00274">

<hr />

The fix would be waiting for dialog to be closed, which indicates that
txn is finished completely, and then we validate the activity. The
following screenshot shows the logs after fix:

<img width="1027" alt="截屏2024-06-02 22 38 06"
src="https://github.com/MetaMask/metamask-extension/assets/12678455/895050de-9311-4445-9702-0e7a18f89ec8">

<!--
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/24998?quickstart=1)

## **Related issues**

Fixes: #24643

## **Manual testing steps**

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

## **Screenshots/Recordings**

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

### **Before**
<img width="1875" alt="截屏2024-06-02 22 36 13"
src="https://github.com/MetaMask/metamask-extension/assets/12678455/2c5378c0-bf6e-46eb-a96b-953967b11943">


https://github.com/MetaMask/metamask-extension/assets/12678455/10efaa39-2566-42a8-b63a-49a5c7f67b50


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

### **After**

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

## **Pre-merge author checklist**

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

## **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.
@gauthierpetetin gauthierpetetin added the release-12.0.0 Issue or pull request that will be included in release 12.0.0 label Jun 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
flaky tests release-12.0.0 Issue or pull request that will be included in release 12.0.0 team-extension-platform
Projects
None yet
4 participants