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

test: fix flakey E2E tests #9413

Merged
merged 9 commits into from
Apr 26, 2024
Merged

test: fix flakey E2E tests #9413

merged 9 commits into from
Apr 26, 2024

Conversation

cortisiko
Copy link
Member

@cortisiko cortisiko commented Apr 25, 2024

Description

The purpose of this PR is to stabilize the e2e tests on main. What was done in this PR:

  • Detox environment setup time and tear down time was increased

    • Why? Detox was attempting to execute tests prior to the simulator/emulator booting up. This caused the tests to fail with the error: Exceeded timeout of 30000ms while tearing down Detox environment or Exceeded timeout of 25000ms while setting up Detox environment
  • There was a duplicate device.launchapp() step in the before hook for the NFT import test. This caused the test to double launch, perhaps a symptom of why the test is unstable.

  • The swap-regression test was flaking on Android as well. The app would fetch quotes when swapping ERC20 <> ETH during the test running, which introduced instability. We should follow up in a separate task to address this.

  • Sign tests in the confirmations folder were also unstable. Each sign spec file contains the following tests: one to sign a transaction and the other to cancel it. Each test used fixtures to set up the app in a specific state. However, this resulted in some instability in the confirmation signature tests. Specifically, a few tests attempted to use a fixture port that was already in use, leading to errors. This needs to be investigated further in a follow-up task. Lastly, The time it takes to run the signature tests was too lengthy.

    • I condense the test actions into one it block, which makes the tests run quicker and more stable.

Related issues

Fixes:

Manual testing steps

  1. Go to this page...

Screenshots/Recordings

Before

After

Passing Smoke tests:
https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/0572909c-97af-40f3-addf-8a2b02da1cf2
https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/f6f1f081-4707-41bc-8c1a-955c6b2a6163
https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/ae68f7f2-34b9-47fa-a31e-47be939ea3ef

Passing regression:
https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/46fe763c-1c62-401f-a6b8-b0b86484ce39

Pre-merge author checklist

  • I’ve followed MetaMask Coding Standards.
  • 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 format if applicable
  • I’ve applied the right labels on the PR (see labeling guidelines). 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.

@cortisiko cortisiko changed the title test: remove duplicate device launch. test: fix flakey E2E tests Apr 26, 2024
@cortisiko cortisiko added No QA Needed Apply this label when your PR does not need any QA effort. team-mobile-platform labels Apr 26, 2024
@cortisiko cortisiko self-assigned this Apr 26, 2024
@cortisiko cortisiko added the Run Smoke E2E Triggers smoke e2e on Bitrise label Apr 26, 2024
Copy link
Contributor

github-actions bot commented Apr 26, 2024

https://bitrise.io/ Bitrise

✅✅✅ pr_smoke_e2e_pipeline passed on Bitrise! ✅✅✅

Commit hash: e0cef75
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/f6f1f081-4707-41bc-8c1a-955c6b2a6163

Note

  • You can kick off another pr_smoke_e2e_pipeline on Bitrise by removing and re-applying the Run Smoke E2E label on the pull request

Copy link

sonarcloud bot commented Apr 26, 2024

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarCloud

@cortisiko cortisiko marked this pull request as ready for review April 26, 2024 14:49
@cortisiko cortisiko requested a review from a team as a code owner April 26, 2024 14:49
Copy link
Contributor

@MarioAslau MarioAslau left a comment

Choose a reason for hiding this comment

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

LGTM !

Copy link
Contributor

@chrisleewilcox chrisleewilcox left a comment

Choose a reason for hiding this comment

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

LGTM

@cortisiko cortisiko merged commit 49d2248 into main Apr 26, 2024
44 checks passed
@cortisiko cortisiko deleted the detox/fix-flakey-nft-test branch April 26, 2024 17:47
@github-actions github-actions bot locked and limited conversation to collaborators Apr 26, 2024
@metamaskbot metamaskbot added the release-7.23.0 Issue or pull request that will be included in release 7.23.0 label Apr 26, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
No QA Needed Apply this label when your PR does not need any QA effort. release-7.23.0 Issue or pull request that will be included in release 7.23.0 Run Smoke E2E Triggers smoke e2e on Bitrise team-mobile-platform
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

4 participants