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: Import flow @no-mmi Import wallet using Secret Recovery Phrase with pasting word by word #26053

Closed
9 tasks
seaona opened this issue Jul 23, 2024 · 0 comments · Fixed by #26049
Closed
9 tasks
Assignees
Labels
flaky tests release-12.3.0 Issue or pull request that will be included in release 12.3.0 Sev2-normal Normal severity; minor loss of service or inconvenience. team-extension-platform

Comments

@seaona
Copy link
Contributor

seaona commented Jul 23, 2024

What is this about?

https://app.circleci.com/pipelines/github/MetaMask/metamask-extension/92953/workflows/ee7ae0a5-2afd-4718-83b9-b5b335f69f82/jobs/3462015/tests

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 added Sev2-normal Normal severity; minor loss of service or inconvenience. team-extension-platform flaky tests labels Jul 23, 2024
@seaona seaona self-assigned this Jul 23, 2024
hjetpoluru pushed a commit that referenced this issue Jul 23, 2024
…ery Phrase with pasting word by word` (#26049)

<!--
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 test `Import flow @no-mmi Import wallet using Secret Recovery Phrase
with pasting word by word` fails because after opting out from
metametrics, we land into the Home page again instead of going to the
Import SRP page, causing the test to fail as the srp element cannot be
located ([ci
failure](https://app.circleci.com/pipelines/github/MetaMask/metamask-extension/92953/workflows/ee7ae0a5-2afd-4718-83b9-b5b335f69f82/jobs/3462015/tests)).

This is a race condition on the wallet level, and not on the test level:
iinstead of going inside the `ONBOARDING_IMPORT_WITH_SRP_ROUTE`
condition, we fallback to the DEFAULT_ROUTE which directs you to home
(see screenshot of the failure):

```
export function getFirstTimeFlowTypeRouteAfterMetaMetricsOptIn(state) {
  const { firstTimeFlowType } = state.metamask;

  if (firstTimeFlowType === FirstTimeFlowType.create) {
    return ONBOARDING_CREATE_PASSWORD_ROUTE;
  } else if (firstTimeFlowType === FirstTimeFlowType.import) {
    return ONBOARDING_IMPORT_WITH_SRP_ROUTE;
  } else if (firstTimeFlowType === FirstTimeFlowType.restore) {
    return ONBOARDING_SECURE_YOUR_WALLET_ROUTE;
  }
  return DEFAULT_ROUTE;
}
```

I am able to consistently reproduce it locally if I add a timeout in the
onImportClick function:

```
  const onImportClick = async () => {
    setTimeout(async () => {
    dispatch(setFirstTimeFlowType(FirstTimeFlowType.import));
    }, 200);
```

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

## **Related issues**

Fixes: #26053

## **Manual testing steps**

1. Check ci hasn''t failed anymore with the `Import flow @no-mmi Import
wallet using Secret Recovery Phrase with pasting word by word`

## **Screenshots/Recordings**
Race condition which lands me back to HOME page:


https://github.com/user-attachments/assets/514c3340-6bc8-41a2-add2-712e19549737





## **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 metamaskbot added the release-12.3.0 Issue or pull request that will be included in release 12.3.0 label Jul 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
flaky tests release-12.3.0 Issue or pull request that will be included in release 12.3.0 Sev2-normal Normal severity; minor loss of service or inconvenience. team-extension-platform
Projects
None yet
2 participants