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: flaky test onboarding @no-mmi doesn't make any network requests to infura before onboarding is completed/test-failure-screenshot-1.png timeout #25525

Merged
merged 3 commits into from
Jun 27, 2024

Conversation

seaona
Copy link
Contributor

@seaona seaona commented Jun 26, 2024

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

Open in GitHub Codespaces

Related issues

Fixes: #25543

Manual testing steps

  1. Check ci

Screenshots/Recordings

Screenshot from 2024-06-26 15-05-52

Pre-merge author checklist

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.

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.

@metamaskbot metamaskbot added the team-confirmations Push issues to confirmations team label Jun 26, 2024
@seaona seaona closed this Jun 26, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Jun 26, 2024
@HowardBraham
Copy link
Contributor

@seaona I think I figured this one out. The mocked eth_getBalance is returning a balance of 0x1 on every account, and because the balance is nonzero, it tries to get the balance of the next account. Here's a screenshot showing more than 100 accounts:

image

I think the solution is:
result: '0x0',
so that it stops querying accounts

@HowardBraham HowardBraham reopened this Jun 26, 2024
@seaona
Copy link
Contributor Author

seaona commented Jun 27, 2024

hey @HowardBraham that's a great finding!!! I confirm I've observed this behaviour occasionally, where the accounts kept growing if I wait several seconds.
Also this could be the cause of the net_version req never happen as it got stuck at the eth_call

[EDIT] It looks like this works on ci. I've also run the test several times locally and seems to fix it! thank you. I've updated the description accordingly

net-verison-missing.mp4

@seaona seaona marked this pull request as ready for review June 27, 2024 06:53
@seaona seaona requested a review from a team as a code owner June 27, 2024 06:53
@metamaskbot
Copy link
Collaborator

Builds ready [604ace6]
Page Load Metrics (48 ± 4 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint661027995
domContentLoaded9141111
load39654884
domInteractive9141111
Bundle size diffs
  • background: 0 Bytes (0.00%)
  • ui: 0 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

Copy link
Contributor

@chloeYue chloeYue left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wow great findings ! LGTM !

@seaona seaona merged commit 6918c52 into develop Jun 27, 2024
79 checks passed
@seaona seaona deleted the flaky-onboarding-requests-missing branch June 27, 2024 07:32
@metamaskbot metamaskbot added the release-12.1.0 Issue or pull request that will be included in release 12.1.0 label Jun 27, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
flaky tests release-12.1.0 Issue or pull request that will be included in release 12.1.0 team-confirmations Push issues to confirmations team
Projects
None yet
4 participants