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

Cherrypick flaky test fix 12.2.0 #26747

Merged
merged 3 commits into from
Aug 30, 2024
Merged

Conversation

chloeYue
Copy link
Contributor

@chloeYue chloeYue commented Aug 29, 2024

Description

Cherrypick 2 flaky test fix in 12.2.0, so it will help future CI to pass quicker for this release.

Open in GitHub Codespaces

Related issues

Fixes:

Manual testing steps

  1. Go to this page...

Screenshots/Recordings

Before

After

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.

…to metrics @no-mmi should send error events in background` (#26216)

[The test is
flaky](https://app.circleci.com/pipelines/github/MetaMask/metamask-extension/94004/workflows/25f428d4-8fcb-4aca-8ddb-49edb51b57cf/jobs/3499122/tests)
as sometimes we get a different error in the mocked endpoint, `Error:
Could not establish connection. Receiving end does not exist`, instead
of the expected one. This is because the condition for entering into the
mock is not strict enough, and both errors include `value":"Cannot read
properties of undefined (reading 'version')` in their body.

The solution here is:
- make the condition mock more strict, to make sure we capture the error
we want (not the `receiving end` one)
- verify that this specific request is mocked - no need to assert on the
json body as we already have this in the mock condition, however we
leave it for debugging purposes. The change that has been made, is to
assert the complete error all in once, so we get a more meaningful
assertion and failure (if that's the case)

---------

Co-authored-by: Mark Stacey <markjstacey@gmail.com>
@chloeYue chloeYue self-assigned this Aug 29, 2024
@chloeYue chloeYue requested review from a team as code owners August 29, 2024 12:31
@chloeYue chloeYue marked this pull request as draft August 29, 2024 12:31
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.

@chloeYue chloeYue changed the title Cherrypick test fix 12.2.0 Cherrypick flaky test fix 12.2.0 Aug 29, 2024
@chloeYue chloeYue removed the request for review from a team August 29, 2024 13:47
seaona and others added 2 commits August 29, 2024 16:17
…S into address bar (#25782)

<!--
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 fix is based on adding a css class `controller-loaded` whenever the
initialization is done and using this class to determine when to proceed
with the test action of navigating to a new page, where we try to
resolve an ens address.

The author of this work is @davidmurdoch
[PR](#25334) , and I
just fixed the conflicts with develop.



Note: 
When I tried to do this in David's branch I got this error, and also if
I try to merge this branch into his, then I see >900 changes against
develop, which is quite strange 🤔 so I'm now targeting develop
directly in this branch, on top of his commits.

![Screenshot from 2024-07-11
20-58-14](https://github.com/user-attachments/assets/c6d43195-2985-409c-88f0-48218ade03f4)

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

## **Related issues**

Fixes:

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

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

### **After**

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

## **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.

---------

Co-authored-by: David Murdoch <david@davidmurdoch.com>
## **Description**
Temporarily disabling the tests that were added
[here](#25060),
because they need to be more stable. Once they are, we can enable them
again.

## **Related issues**

Fixes:

## **Manual testing steps**
1. `test-e2e-swap-playwright - OPTIONAL` step will not be run in a pull
request.

## **Screenshots/Recordings**

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

### **Before**

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

### **After**

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

## **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.
@metamaskbot
Copy link
Collaborator

Builds ready [4564ed1]
Page Load Metrics (736 ± 489 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint703051275024
domContentLoaded107421147
load4425357361018489
domInteractive107420147

Copy link

codecov bot commented Aug 29, 2024

Codecov Report

Attention: Patch coverage is 0% with 13 lines in your changes missing coverage. Please review.

Project coverage is 70.17%. Comparing base (38b51cd) to head (3de4857).

Files with missing lines Patch % Lines
app/scripts/background.js 0.00% 8 Missing ⚠️
app/scripts/lib/ens-ipfs/setup.js 0.00% 3 Missing ⚠️
app/scripts/ui.js 0.00% 2 Missing ⚠️
Additional details and impacted files
@@                 Coverage Diff                 @@
##           Version-v12.2.0   #26747      +/-   ##
===================================================
- Coverage            70.18%   70.17%   -0.01%     
===================================================
  Files                 1398     1398              
  Lines                49351    49358       +7     
  Branches             13566    13569       +3     
===================================================
  Hits                 34633    34633              
- Misses               14718    14725       +7     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@chloeYue chloeYue marked this pull request as ready for review August 29, 2024 17:00
@chloeYue chloeYue requested review from a team and kumavis as code owners August 29, 2024 17:00
@chloeYue chloeYue removed request for a team and kumavis August 29, 2024 17:00
@metamaskbot
Copy link
Collaborator

Builds ready [3de4857]
Page Load Metrics (431 ± 351 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint663431115627
domContentLoaded95928157
load402072431731351
domInteractive95928157

Copy link
Contributor

@benjisclowder benjisclowder left a comment

Choose a reason for hiding this comment

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

LGTM!

@chloeYue chloeYue merged commit f6c455b into Version-v12.2.0 Aug 30, 2024
66 checks passed
@chloeYue chloeYue deleted the cherrypick-test-fix-12.2.0 branch August 30, 2024 09:45
@github-actions github-actions bot locked and limited conversation to collaborators Aug 30, 2024
@metamaskbot metamaskbot added the release-12.2.0 Issue or pull request that will be included in release 12.2.0 label Aug 30, 2024
@metamaskbot
Copy link
Collaborator

No release label on PR. Adding release label release-12.2.0 on PR, as PR was cherry-picked in branch 12.2.0.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
release-12.2.0 Issue or pull request that will be included in release 12.2.0 team-extension-platform
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants