Skip to content

Commit

Permalink
fix: flaky test ` onboarding @no-mmi doesn't make any network request…
Browse files Browse the repository at this point in the history
…s to infura before onboarding is completed/test-failure-screenshot-1.png` timeout (#25525)

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

This test appears flaky as sometimes not all the requests are made when
we finish the onboarding. Notice how, we mock 5 requests, but in the
logs, only 4 appear after the onboarding. Specifically the `net_version`
request doesn't happen in this case.

[EDIT] It seems that the explanation for this is what @HowardBraham
mentions below: since we mock the balance as non-zero, the wallet keeps
querying the balance for the subsequent accounts. This could be that
causes the wallet to enter in a non-finishing loop, and the
`net_version` request is also never triggered (see this should happen
after the `eth_call`)


![image](https://github.com/MetaMask/metamask-extension/assets/54408225/291d94f5-e0aa-4ff9-b96b-46c8bcdd7cc8)


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

## **Related issues**

Fixes: #25543

## **Manual testing steps**

1. Check ci

## **Screenshots/Recordings**

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

![Screenshot from 2024-06-26
15-05-52](https://github.com/MetaMask/metamask-extension/assets/54408225/93a9d29c-10ca-479d-9e67-e76c46c23fb8)


## **Pre-merge author checklist**

- [ ] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask
Extension 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.
  • Loading branch information
seaona authored Jun 27, 2024
1 parent ff26dc8 commit 6918c52
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions test/e2e/tests/onboarding/onboarding.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ describe('MetaMask onboarding @no-mmi', function () {
json: {
jsonrpc: '2.0',
id: '1111111111111111',
result: '0x1',
result: '0x0',
},
};
}),
Expand Down Expand Up @@ -508,7 +508,7 @@ describe('MetaMask onboarding @no-mmi', function () {
json: {
jsonrpc: '2.0',
id: '1111111111111111',
result: '0x1',
result: '0x0',
},
};
}),
Expand Down

0 comments on commit 6918c52

Please sign in to comment.