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: Multiple onboarding tests failing due to an error where the "Create a new wallet" button cannot be found. #24602

Closed
5 of 14 tasks
chloeYue opened this issue May 20, 2024 · 4 comments · Fixed by #24789 or #24813
Assignees
Labels
flaky tests release-11.16.6 Issue or pull request that will be included in release 11.16.6 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

chloeYue commented May 20, 2024

What is this about?

Reason of flakiness:
We are trying to find button on wrong screen! Need to check why we are not on expected screen.

Related tests:

  • MetaMask onboarding @no-mmi Clicks create a new wallet, accepts a secure password, reveals the Secret Recovery Phrase, confirm SRP --> this one is a different error
  • Wallet Created Events @no-mmi are not sent when onboarding user who chooses to opt out metrics
  • MetaMask onboarding @no-mmi doesn't make any network requests to infura before onboarding is completed --> this one is a different error
  • MetaMask onboarding @no-mmi Verify that the user has been redirected to the correct page after creating a password for their new wallet
  • MetaMask onboarding @no-mmi User enters the wrong password during password creation

Failure:
https://app.circleci.com/pipelines/github/MetaMask/metamask-extension/81133/workflows/0b962d69-e9d4-4c3e-9ca0-cfa829b667e2/jobs/2874094/tests

https://app.circleci.com/pipelines/github/MetaMask/metamask-extension/81118/workflows/04fa31d6-ea90-4e1d-9161-0e61fb05b85e/jobs/2873306/tests

https://app.circleci.com/pipelines/github/MetaMask/metamask-extension/81133/workflows/0b962d69-e9d4-4c3e-9ca0-cfa829b667e2/jobs/2874102/tests

https://app.circleci.com/pipelines/github/MetaMask/metamask-extension/81161/workflows/6a426c81-7fda-427d-b5de-2088b70ef326/jobs/2875750/tests

https://app.circleci.com/pipelines/github/MetaMask/metamask-extension/81169/workflows/dd9b42f9-1082-4dfa-a40d-4912b6deacbf/jobs/2876149/tests

Error message
Screenshot 2024-05-20 at 10 55 43

Screenshot 2024-05-20 at 11 36 43

Screenshot 2024-05-20 at 11 43 55

Screenshot 2024-05-20 at 13 51 53

Screenshot
Screenshot 2024-05-20 at 10 55 52

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

@chloeYue chloeYue changed the title Flaky Test: "MetaMask onboarding @no-mmi Clicks create a new wallet, accepts a secure password, reveals the Secret Recovery Phrase, confirm SRP" Flaky Test: Multiple onboarding tests failing with error " Waiting for element to be located By(css selector, [data-testid="create-password-new"])" May 20, 2024
@chloeYue chloeYue changed the title Flaky Test: Multiple onboarding tests failing with error " Waiting for element to be located By(css selector, [data-testid="create-password-new"])" Flaky Test: Multiple onboarding tests failing due to an error where the "Create New Password" button cannot be found. May 20, 2024
@chloeYue chloeYue changed the title Flaky Test: Multiple onboarding tests failing due to an error where the "Create New Password" button cannot be found. Flaky Test: Multiple onboarding tests failing due to an error where the "Create a new wallet" button cannot be found. May 20, 2024
@seaona
Copy link
Contributor

seaona commented May 27, 2024

Wallet Created Events @no-mmi are not sent when onboarding user who chooses to opt out metrics

The problem seems to be that sometimes linux doesn't find the sound card. This happens specifically to the onboarding tests that go to the video screen

image

ALSA lib confmisc.c:855:(parse_card) cannot find card '0'
ALSA lib conf.c:5178:(_snd_config_evaluate) function snd_func_card_inum returned error: No such file or directory
ALSA lib confmisc.c:422:(snd_func_concat) error evaluating strings
ALSA lib conf.c:5178:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory
ALSA lib confmisc.c:1334:(snd_func_refer) error evaluating name
ALSA lib conf.c:5178:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5701:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2664:(snd_pcm_open_noupdate) Unknown PCM default

https://app.circleci.com/pipelines/github/MetaMask/metamask-extension/82995/workflows/51b18b16-f786-4ee8-96d0-9c751af6fa17/jobs/2965494/artifacts

@seaona seaona self-assigned this May 27, 2024
seaona added a commit that referenced this issue May 27, 2024
…onboarding user who chooses to opt out metrics` (#24789)

## **Description**
The problem seems to be that sometimes Linux is not able to find the
sound card (for unknown reasons). This happens specifically to any of
the onboarding tests that go to the video screen.

Context: other Linux users reporting this error `ALSA lib
confmisc.c:855:(parse_card) cannot find card '0'` can be found
[here](https://forums.debian.net/viewtopic.php?t=53516).

```
ALSA lib confmisc.c:855:(parse_card) cannot find card '0'
ALSA lib conf.c:5178:(_snd_config_evaluate) function snd_func_card_inum returned error: No such file or directory
ALSA lib confmisc.c:422:(snd_func_concat) error evaluating strings
ALSA lib conf.c:5178:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory
ALSA lib confmisc.c:1334:(snd_func_refer) error evaluating name
ALSA lib conf.c:5178:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5701:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2664:(snd_pcm_open_noupdate) Unknown PCM default
```

The solution is to not render the video Box component if we are in test
mode.

Circleci failures:
https://app.circleci.com/pipelines/github/MetaMask/metamask-extension/82995/workflows/51b18b16-f786-4ee8-96d0-9c751af6fa17/jobs/2965494/artifacts

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

## **Related issues**

Fixes: #24602

## **Manual testing steps**

1. Check ci run

## **Screenshots/Recordings**
Artifacts from ci: test fails at the screen with the video


![image](https://github.com/MetaMask/metamask-extension/assets/54408225/6e3bfdc7-ee15-4961-ab7a-d77b69ac2e55)




## **Pre-merge author checklist**

- [x] I’ve followed [MetaMask Coding
Standards](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/CODING_GUIDELINES.md).
- [x] I've completed the PR template to the best of my ability
- [x] I’ve included tests if applicable
- [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [x] 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.
@seaona
Copy link
Contributor

seaona commented May 27, 2024

I Re-open the ticket as it looks like there are 2 items of this list which fail with a different error:

[0527/155657.773197:ERROR:file_io_posix.cc(145)] open /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq: No such file or directory (2)
[0527/155657.773253:ERROR:file_io_posix.cc(145)] open /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq: No such file or directory (2)

It also seems a Linux related issue

@seaona seaona reopened this May 27, 2024
seaona added a commit that referenced this issue May 28, 2024
… to infura before onboarding is completed/test-failure-screenshot.png` and `onboarding @no-mmi Clicks create a new wallet, accepts a secure password, reveals the Secret Recovery Phrase, confirm SRP/test-failure-screenshot.png` (#24813)

## **Description**
This PR fixes more onboarding flakiness `onboarding @no-mmi doesn't make
any network requests to infura before onboarding is
completed/test-failure-screenshot.pn` and `onboarding @no-mmi Clicks
create a new wallet, accepts a secure password, reveals the Secret
Recovery Phrase, confirm SRP/test-failure-screenshot.png` .

The error is originated when we try to click an element which is in
stale state `StaleElementReferenceError: stale element reference: stale
element not found in the current frame`.
This is a race condition originated in the `clickElement` method, in the
following way:
1. we try to find the clickable element
2. the element is refreshed in between
3. right after, we try to click the element from 1 --> this results in
the element being stale, as the element we are trying to click is an old
instance (1) instead of (2)

![Screenshot from 2024-05-28
14-43-54](https://github.com/MetaMask/metamask-extension/assets/54408225/da3a9fdc-28e3-4207-a843-65b9a333916d)

Extra note: this race condition is surfaced in the Onboarding tests
mostly (I've only seen it fail there, so far), since I suspect that the
the actions we perform there, all refresh the same react component for
onboarding, giving a window for this casuistic to happen

- Circle ci job failures:
https://app.circleci.com/pipelines/github/MetaMask/metamask-extension/83037/workflows/b435d63d-e50c-4dcd-af7d-4f6e0856ab6c/jobs/2967823/artifacts
- Circle ci logs:

![Screenshot from 2024-05-28
14-37-47](https://github.com/MetaMask/metamask-extension/assets/54408225/e2b5e859-601b-4f45-a6c0-5141b1fa63e8)


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

## **Related issues**

Fixes: #24602
(remaining items)

## **Manual testing steps**

1. Check ci or run onboarding tests multiple times (though I've never
been able to repro this locally)

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

- [x] I’ve followed [MetaMask Coding
Standards](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/CODING_GUIDELINES.md).
- [x] I've completed the PR template to the best of my ability
- [x] I’ve included tests if applicable
- [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [x] 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.
danjm pushed a commit that referenced this issue May 31, 2024
…onboarding user who chooses to opt out metrics` (#24789)

## **Description**
The problem seems to be that sometimes Linux is not able to find the
sound card (for unknown reasons). This happens specifically to any of
the onboarding tests that go to the video screen.

Context: other Linux users reporting this error `ALSA lib
confmisc.c:855:(parse_card) cannot find card '0'` can be found
[here](https://forums.debian.net/viewtopic.php?t=53516).

```
ALSA lib confmisc.c:855:(parse_card) cannot find card '0'
ALSA lib conf.c:5178:(_snd_config_evaluate) function snd_func_card_inum returned error: No such file or directory
ALSA lib confmisc.c:422:(snd_func_concat) error evaluating strings
ALSA lib conf.c:5178:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory
ALSA lib confmisc.c:1334:(snd_func_refer) error evaluating name
ALSA lib conf.c:5178:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5701:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2664:(snd_pcm_open_noupdate) Unknown PCM default
```

The solution is to not render the video Box component if we are in test
mode.

Circleci failures:
https://app.circleci.com/pipelines/github/MetaMask/metamask-extension/82995/workflows/51b18b16-f786-4ee8-96d0-9c751af6fa17/jobs/2965494/artifacts

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

## **Related issues**

Fixes: #24602

## **Manual testing steps**

1. Check ci run

## **Screenshots/Recordings**
Artifacts from ci: test fails at the screen with the video


![image](https://github.com/MetaMask/metamask-extension/assets/54408225/6e3bfdc7-ee15-4961-ab7a-d77b69ac2e55)




## **Pre-merge author checklist**

- [x] I’ve followed [MetaMask Coding
Standards](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/CODING_GUIDELINES.md).
- [x] I've completed the PR template to the best of my ability
- [x] I’ve included tests if applicable
- [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [x] 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.
danjm pushed a commit that referenced this issue May 31, 2024
… to infura before onboarding is completed/test-failure-screenshot.png` and `onboarding @no-mmi Clicks create a new wallet, accepts a secure password, reveals the Secret Recovery Phrase, confirm SRP/test-failure-screenshot.png` (#24813)

## **Description**
This PR fixes more onboarding flakiness `onboarding @no-mmi doesn't make
any network requests to infura before onboarding is
completed/test-failure-screenshot.pn` and `onboarding @no-mmi Clicks
create a new wallet, accepts a secure password, reveals the Secret
Recovery Phrase, confirm SRP/test-failure-screenshot.png` .

The error is originated when we try to click an element which is in
stale state `StaleElementReferenceError: stale element reference: stale
element not found in the current frame`.
This is a race condition originated in the `clickElement` method, in the
following way:
1. we try to find the clickable element
2. the element is refreshed in between
3. right after, we try to click the element from 1 --> this results in
the element being stale, as the element we are trying to click is an old
instance (1) instead of (2)

![Screenshot from 2024-05-28
14-43-54](https://github.com/MetaMask/metamask-extension/assets/54408225/da3a9fdc-28e3-4207-a843-65b9a333916d)

Extra note: this race condition is surfaced in the Onboarding tests
mostly (I've only seen it fail there, so far), since I suspect that the
the actions we perform there, all refresh the same react component for
onboarding, giving a window for this casuistic to happen

- Circle ci job failures:
https://app.circleci.com/pipelines/github/MetaMask/metamask-extension/83037/workflows/b435d63d-e50c-4dcd-af7d-4f6e0856ab6c/jobs/2967823/artifacts
- Circle ci logs:

![Screenshot from 2024-05-28
14-37-47](https://github.com/MetaMask/metamask-extension/assets/54408225/e2b5e859-601b-4f45-a6c0-5141b1fa63e8)


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

## **Related issues**

Fixes: #24602
(remaining items)

## **Manual testing steps**

1. Check ci or run onboarding tests multiple times (though I've never
been able to repro this locally)

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

- [x] I’ve followed [MetaMask Coding
Standards](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/CODING_GUIDELINES.md).
- [x] I've completed the PR template to the best of my ability
- [x] I’ve included tests if applicable
- [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [x] 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.
danjm pushed a commit that referenced this issue May 31, 2024
…onboarding user who chooses to opt out metrics` (#24789)

## **Description**
The problem seems to be that sometimes Linux is not able to find the
sound card (for unknown reasons). This happens specifically to any of
the onboarding tests that go to the video screen.

Context: other Linux users reporting this error `ALSA lib
confmisc.c:855:(parse_card) cannot find card '0'` can be found
[here](https://forums.debian.net/viewtopic.php?t=53516).

```
ALSA lib confmisc.c:855:(parse_card) cannot find card '0'
ALSA lib conf.c:5178:(_snd_config_evaluate) function snd_func_card_inum returned error: No such file or directory
ALSA lib confmisc.c:422:(snd_func_concat) error evaluating strings
ALSA lib conf.c:5178:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory
ALSA lib confmisc.c:1334:(snd_func_refer) error evaluating name
ALSA lib conf.c:5178:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5701:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2664:(snd_pcm_open_noupdate) Unknown PCM default
```

The solution is to not render the video Box component if we are in test
mode.

Circleci failures:
https://app.circleci.com/pipelines/github/MetaMask/metamask-extension/82995/workflows/51b18b16-f786-4ee8-96d0-9c751af6fa17/jobs/2965494/artifacts

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

## **Related issues**

Fixes: #24602

## **Manual testing steps**

1. Check ci run

## **Screenshots/Recordings**
Artifacts from ci: test fails at the screen with the video


![image](https://github.com/MetaMask/metamask-extension/assets/54408225/6e3bfdc7-ee15-4961-ab7a-d77b69ac2e55)




## **Pre-merge author checklist**

- [x] I’ve followed [MetaMask Coding
Standards](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/CODING_GUIDELINES.md).
- [x] I've completed the PR template to the best of my ability
- [x] I’ve included tests if applicable
- [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [x] 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.
danjm pushed a commit that referenced this issue May 31, 2024
… to infura before onboarding is completed/test-failure-screenshot.png` and `onboarding @no-mmi Clicks create a new wallet, accepts a secure password, reveals the Secret Recovery Phrase, confirm SRP/test-failure-screenshot.png` (#24813)

## **Description**
This PR fixes more onboarding flakiness `onboarding @no-mmi doesn't make
any network requests to infura before onboarding is
completed/test-failure-screenshot.pn` and `onboarding @no-mmi Clicks
create a new wallet, accepts a secure password, reveals the Secret
Recovery Phrase, confirm SRP/test-failure-screenshot.png` .

The error is originated when we try to click an element which is in
stale state `StaleElementReferenceError: stale element reference: stale
element not found in the current frame`.
This is a race condition originated in the `clickElement` method, in the
following way:
1. we try to find the clickable element
2. the element is refreshed in between
3. right after, we try to click the element from 1 --> this results in
the element being stale, as the element we are trying to click is an old
instance (1) instead of (2)

![Screenshot from 2024-05-28
14-43-54](https://github.com/MetaMask/metamask-extension/assets/54408225/da3a9fdc-28e3-4207-a843-65b9a333916d)

Extra note: this race condition is surfaced in the Onboarding tests
mostly (I've only seen it fail there, so far), since I suspect that the
the actions we perform there, all refresh the same react component for
onboarding, giving a window for this casuistic to happen

- Circle ci job failures:
https://app.circleci.com/pipelines/github/MetaMask/metamask-extension/83037/workflows/b435d63d-e50c-4dcd-af7d-4f6e0856ab6c/jobs/2967823/artifacts
- Circle ci logs:

![Screenshot from 2024-05-28
14-37-47](https://github.com/MetaMask/metamask-extension/assets/54408225/e2b5e859-601b-4f45-a6c0-5141b1fa63e8)


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

## **Related issues**

Fixes: #24602
(remaining items)

## **Manual testing steps**

1. Check ci or run onboarding tests multiple times (though I've never
been able to repro this locally)

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

- [x] I’ve followed [MetaMask Coding
Standards](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/CODING_GUIDELINES.md).
- [x] I've completed the PR template to the best of my ability
- [x] I’ve included tests if applicable
- [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [x] 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.
danjm pushed a commit that referenced this issue May 31, 2024
…onboarding user who chooses to opt out metrics` (#24789)

## **Description**
The problem seems to be that sometimes Linux is not able to find the
sound card (for unknown reasons). This happens specifically to any of
the onboarding tests that go to the video screen.

Context: other Linux users reporting this error `ALSA lib
confmisc.c:855:(parse_card) cannot find card '0'` can be found
[here](https://forums.debian.net/viewtopic.php?t=53516).

```
ALSA lib confmisc.c:855:(parse_card) cannot find card '0'
ALSA lib conf.c:5178:(_snd_config_evaluate) function snd_func_card_inum returned error: No such file or directory
ALSA lib confmisc.c:422:(snd_func_concat) error evaluating strings
ALSA lib conf.c:5178:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory
ALSA lib confmisc.c:1334:(snd_func_refer) error evaluating name
ALSA lib conf.c:5178:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5701:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2664:(snd_pcm_open_noupdate) Unknown PCM default
```

The solution is to not render the video Box component if we are in test
mode.

Circleci failures:
https://app.circleci.com/pipelines/github/MetaMask/metamask-extension/82995/workflows/51b18b16-f786-4ee8-96d0-9c751af6fa17/jobs/2965494/artifacts

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

## **Related issues**

Fixes: #24602

## **Manual testing steps**

1. Check ci run

## **Screenshots/Recordings**
Artifacts from ci: test fails at the screen with the video


![image](https://github.com/MetaMask/metamask-extension/assets/54408225/6e3bfdc7-ee15-4961-ab7a-d77b69ac2e55)




## **Pre-merge author checklist**

- [x] I’ve followed [MetaMask Coding
Standards](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/CODING_GUIDELINES.md).
- [x] I've completed the PR template to the best of my ability
- [x] I’ve included tests if applicable
- [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [x] 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.
danjm pushed a commit that referenced this issue May 31, 2024
… to infura before onboarding is completed/test-failure-screenshot.png` and `onboarding @no-mmi Clicks create a new wallet, accepts a secure password, reveals the Secret Recovery Phrase, confirm SRP/test-failure-screenshot.png` (#24813)

## **Description**
This PR fixes more onboarding flakiness `onboarding @no-mmi doesn't make
any network requests to infura before onboarding is
completed/test-failure-screenshot.pn` and `onboarding @no-mmi Clicks
create a new wallet, accepts a secure password, reveals the Secret
Recovery Phrase, confirm SRP/test-failure-screenshot.png` .

The error is originated when we try to click an element which is in
stale state `StaleElementReferenceError: stale element reference: stale
element not found in the current frame`.
This is a race condition originated in the `clickElement` method, in the
following way:
1. we try to find the clickable element
2. the element is refreshed in between
3. right after, we try to click the element from 1 --> this results in
the element being stale, as the element we are trying to click is an old
instance (1) instead of (2)

![Screenshot from 2024-05-28
14-43-54](https://github.com/MetaMask/metamask-extension/assets/54408225/da3a9fdc-28e3-4207-a843-65b9a333916d)

Extra note: this race condition is surfaced in the Onboarding tests
mostly (I've only seen it fail there, so far), since I suspect that the
the actions we perform there, all refresh the same react component for
onboarding, giving a window for this casuistic to happen

- Circle ci job failures:
https://app.circleci.com/pipelines/github/MetaMask/metamask-extension/83037/workflows/b435d63d-e50c-4dcd-af7d-4f6e0856ab6c/jobs/2967823/artifacts
- Circle ci logs:

![Screenshot from 2024-05-28
14-37-47](https://github.com/MetaMask/metamask-extension/assets/54408225/e2b5e859-601b-4f45-a6c0-5141b1fa63e8)


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

## **Related issues**

Fixes: #24602
(remaining items)

## **Manual testing steps**

1. Check ci or run onboarding tests multiple times (though I've never
been able to repro this locally)

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

- [x] I’ve followed [MetaMask Coding
Standards](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/CODING_GUIDELINES.md).
- [x] I've completed the PR template to the best of my ability
- [x] I’ve included tests if applicable
- [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [x] 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.
danjm pushed a commit that referenced this issue May 31, 2024
…onboarding user who chooses to opt out metrics` (#24789)

## **Description**
The problem seems to be that sometimes Linux is not able to find the
sound card (for unknown reasons). This happens specifically to any of
the onboarding tests that go to the video screen.

Context: other Linux users reporting this error `ALSA lib
confmisc.c:855:(parse_card) cannot find card '0'` can be found
[here](https://forums.debian.net/viewtopic.php?t=53516).

```
ALSA lib confmisc.c:855:(parse_card) cannot find card '0'
ALSA lib conf.c:5178:(_snd_config_evaluate) function snd_func_card_inum returned error: No such file or directory
ALSA lib confmisc.c:422:(snd_func_concat) error evaluating strings
ALSA lib conf.c:5178:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory
ALSA lib confmisc.c:1334:(snd_func_refer) error evaluating name
ALSA lib conf.c:5178:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5701:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2664:(snd_pcm_open_noupdate) Unknown PCM default
```

The solution is to not render the video Box component if we are in test
mode.

Circleci failures:
https://app.circleci.com/pipelines/github/MetaMask/metamask-extension/82995/workflows/51b18b16-f786-4ee8-96d0-9c751af6fa17/jobs/2965494/artifacts

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

## **Related issues**

Fixes: #24602

## **Manual testing steps**

1. Check ci run

## **Screenshots/Recordings**
Artifacts from ci: test fails at the screen with the video


![image](https://github.com/MetaMask/metamask-extension/assets/54408225/6e3bfdc7-ee15-4961-ab7a-d77b69ac2e55)




## **Pre-merge author checklist**

- [x] I’ve followed [MetaMask Coding
Standards](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/CODING_GUIDELINES.md).
- [x] I've completed the PR template to the best of my ability
- [x] I’ve included tests if applicable
- [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [x] 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.
danjm pushed a commit that referenced this issue May 31, 2024
… to infura before onboarding is completed/test-failure-screenshot.png` and `onboarding @no-mmi Clicks create a new wallet, accepts a secure password, reveals the Secret Recovery Phrase, confirm SRP/test-failure-screenshot.png` (#24813)

## **Description**
This PR fixes more onboarding flakiness `onboarding @no-mmi doesn't make
any network requests to infura before onboarding is
completed/test-failure-screenshot.pn` and `onboarding @no-mmi Clicks
create a new wallet, accepts a secure password, reveals the Secret
Recovery Phrase, confirm SRP/test-failure-screenshot.png` .

The error is originated when we try to click an element which is in
stale state `StaleElementReferenceError: stale element reference: stale
element not found in the current frame`.
This is a race condition originated in the `clickElement` method, in the
following way:
1. we try to find the clickable element
2. the element is refreshed in between
3. right after, we try to click the element from 1 --> this results in
the element being stale, as the element we are trying to click is an old
instance (1) instead of (2)

![Screenshot from 2024-05-28
14-43-54](https://github.com/MetaMask/metamask-extension/assets/54408225/da3a9fdc-28e3-4207-a843-65b9a333916d)

Extra note: this race condition is surfaced in the Onboarding tests
mostly (I've only seen it fail there, so far), since I suspect that the
the actions we perform there, all refresh the same react component for
onboarding, giving a window for this casuistic to happen

- Circle ci job failures:
https://app.circleci.com/pipelines/github/MetaMask/metamask-extension/83037/workflows/b435d63d-e50c-4dcd-af7d-4f6e0856ab6c/jobs/2967823/artifacts
- Circle ci logs:

![Screenshot from 2024-05-28
14-37-47](https://github.com/MetaMask/metamask-extension/assets/54408225/e2b5e859-601b-4f45-a6c0-5141b1fa63e8)


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

## **Related issues**

Fixes: #24602
(remaining items)

## **Manual testing steps**

1. Check ci or run onboarding tests multiple times (though I've never
been able to repro this locally)

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

- [x] I’ve followed [MetaMask Coding
Standards](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/CODING_GUIDELINES.md).
- [x] I've completed the PR template to the best of my ability
- [x] I’ve included tests if applicable
- [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [x] 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.
danjm pushed a commit that referenced this issue Jun 4, 2024
…onboarding user who chooses to opt out metrics` (#24789)

## **Description**
The problem seems to be that sometimes Linux is not able to find the
sound card (for unknown reasons). This happens specifically to any of
the onboarding tests that go to the video screen.

Context: other Linux users reporting this error `ALSA lib
confmisc.c:855:(parse_card) cannot find card '0'` can be found
[here](https://forums.debian.net/viewtopic.php?t=53516).

```
ALSA lib confmisc.c:855:(parse_card) cannot find card '0'
ALSA lib conf.c:5178:(_snd_config_evaluate) function snd_func_card_inum returned error: No such file or directory
ALSA lib confmisc.c:422:(snd_func_concat) error evaluating strings
ALSA lib conf.c:5178:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory
ALSA lib confmisc.c:1334:(snd_func_refer) error evaluating name
ALSA lib conf.c:5178:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5701:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2664:(snd_pcm_open_noupdate) Unknown PCM default
```

The solution is to not render the video Box component if we are in test
mode.

Circleci failures:
https://app.circleci.com/pipelines/github/MetaMask/metamask-extension/82995/workflows/51b18b16-f786-4ee8-96d0-9c751af6fa17/jobs/2965494/artifacts

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

## **Related issues**

Fixes: #24602

## **Manual testing steps**

1. Check ci run

## **Screenshots/Recordings**
Artifacts from ci: test fails at the screen with the video


![image](https://github.com/MetaMask/metamask-extension/assets/54408225/6e3bfdc7-ee15-4961-ab7a-d77b69ac2e55)




## **Pre-merge author checklist**

- [x] I’ve followed [MetaMask Coding
Standards](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/CODING_GUIDELINES.md).
- [x] I've completed the PR template to the best of my ability
- [x] I’ve included tests if applicable
- [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [x] 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.
danjm pushed a commit that referenced this issue Jun 4, 2024
… to infura before onboarding is completed/test-failure-screenshot.png` and `onboarding @no-mmi Clicks create a new wallet, accepts a secure password, reveals the Secret Recovery Phrase, confirm SRP/test-failure-screenshot.png` (#24813)

## **Description**
This PR fixes more onboarding flakiness `onboarding @no-mmi doesn't make
any network requests to infura before onboarding is
completed/test-failure-screenshot.pn` and `onboarding @no-mmi Clicks
create a new wallet, accepts a secure password, reveals the Secret
Recovery Phrase, confirm SRP/test-failure-screenshot.png` .

The error is originated when we try to click an element which is in
stale state `StaleElementReferenceError: stale element reference: stale
element not found in the current frame`.
This is a race condition originated in the `clickElement` method, in the
following way:
1. we try to find the clickable element
2. the element is refreshed in between
3. right after, we try to click the element from 1 --> this results in
the element being stale, as the element we are trying to click is an old
instance (1) instead of (2)

![Screenshot from 2024-05-28
14-43-54](https://github.com/MetaMask/metamask-extension/assets/54408225/da3a9fdc-28e3-4207-a843-65b9a333916d)

Extra note: this race condition is surfaced in the Onboarding tests
mostly (I've only seen it fail there, so far), since I suspect that the
the actions we perform there, all refresh the same react component for
onboarding, giving a window for this casuistic to happen

- Circle ci job failures:
https://app.circleci.com/pipelines/github/MetaMask/metamask-extension/83037/workflows/b435d63d-e50c-4dcd-af7d-4f6e0856ab6c/jobs/2967823/artifacts
- Circle ci logs:

![Screenshot from 2024-05-28
14-37-47](https://github.com/MetaMask/metamask-extension/assets/54408225/e2b5e859-601b-4f45-a6c0-5141b1fa63e8)


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

## **Related issues**

Fixes: #24602
(remaining items)

## **Manual testing steps**

1. Check ci or run onboarding tests multiple times (though I've never
been able to repro this locally)

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

- [x] I’ve followed [MetaMask Coding
Standards](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/CODING_GUIDELINES.md).
- [x] I've completed the PR template to the best of my ability
- [x] I’ve included tests if applicable
- [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [x] 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-11.16.6 Issue or pull request that will be included in release 11.16.6 label Jun 4, 2024
@metamaskbot
Copy link
Collaborator

Missing release label release-11.16.6 on issue. Adding release label release-11.16.6 on issue, as issue is linked to PR #24789 which has this release label.

@metamaskbot
Copy link
Collaborator

Missing release label release-11.16.6 on issue. Adding release label release-11.16.6 on issue, as issue is linked to PR #24813 which has this release label.

@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