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: Fix intermittent install failures #9343

Merged
merged 1 commit into from
Apr 22, 2024

Conversation

Gudahtt
Copy link
Member

@Gudahtt Gudahtt commented Apr 22, 2024

Description

A new setup script was introduced in #9025 that caused certain parts of the yarn setup command to run in parallel. Since then we have been seeing intermittent failures during setup, for example this failed build: https://app.bitrise.io/build/f748e322-fc0b-4c1a-ae72-5a7ce642304a#c69dfbdb-778d-4ba1-b2a0-c71088b0f878-error

This failure is caused by the "React Native nodeify" step running in parallel with the "allow-scripts" step, which runs install scripts needed by later setup steps.

The setup script has been updated to run these steps sequentially, as they were run before. There are opportunities to do some of these steps in parallel, but we need to ensure that any steps that operate on node_modules run in a predictable order and complete prior to any later steps that rely on node_modules.

Related issues

Fixes #9344

Relates to #9025

Manual testing steps

The problem appears intermittently in CI. I don't know of a reliable way to reproduce this, but you could artificially create that situation on main by adding a delay before allow-scripts is run. On this branch, setup will complete without error even if allow-scripts is delayed (because the post install steps now wait for the setup steps to complete before running).

To ensure this doesn't introduce any additional regressions, I'd recommend running yarn setup then ensuring the build works. Though Bitrise should be effective in testing that.

Screenshots/Recordings

N/A

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.

A new setup script was introduced in #9025 that caused certain parts of
the `yarn setup` command to run in parallel. Since then we have been
seeing intermittent failures during setup, for example this failed
build: https://app.bitrise.io/build/f748e322-fc0b-4c1a-ae72-5a7ce642304a#c69dfbdb-778d-4ba1-b2a0-c71088b0f878-error

This failure is caused by the "React Native nodeify" step running in
parallel with the "allow-scripts" step, which runs install scripts
needed by later setup steps.

The setup script has been updated to run these steps sequentially, as
they were run before. There are opportunities to do some of these steps
in parallel, but we need to ensure that any steps that operate on
`node_modules` run in a predictable order and complete prior to any
later steps that rely on `node_modules`.
@Gudahtt Gudahtt added team-mobile-platform Run Smoke E2E Triggers smoke e2e on Bitrise labels Apr 22, 2024
Copy link
Contributor

github-actions bot commented Apr 22, 2024

https://bitrise.io/ Bitrise

❌❌❌ pr_smoke_e2e_pipeline failed on Bitrise! ❌❌❌

Commit hash: 2e680d2
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/31742a57-2d78-419d-adf5-d3dd5e81b4ce

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 22, 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

@Gudahtt Gudahtt marked this pull request as ready for review April 22, 2024 15:29
@Gudahtt Gudahtt requested a review from a team as a code owner April 22, 2024 15:29
@Gudahtt
Copy link
Member Author

Gudahtt commented Apr 22, 2024

There are some E2E failures, but they appear to be issues that already exist on main

Copy link
Member

@gantunesr gantunesr 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
Member

@cortisiko cortisiko left a comment

Choose a reason for hiding this comment

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

✅ ✅ ✅

@Gudahtt Gudahtt merged commit cd81b17 into main Apr 22, 2024
39 of 40 checks passed
@Gudahtt Gudahtt deleted the fix-intermittent-install-failures branch April 22, 2024 16:02
@github-actions github-actions bot locked and limited conversation to collaborators Apr 22, 2024
@metamaskbot metamaskbot added release-7.22.0 Issue or pull request that will be included in release 7.22.0 release-7.21.0 Issue or pull request that will be included in release 7.21.0 and removed release-7.22.0 Issue or pull request that will be included in release 7.22.0 labels Apr 22, 2024
@metamaskbot
Copy link
Collaborator

Missing release label release-7.21.0 on PR. Adding release label release-7.21.0 on PR and removing other release labels(release-7.22.0), as PR was cherry-picked in branch 7.21.0.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
release-7.21.0 Issue or pull request that will be included in release 7.21.0 Run Smoke E2E Triggers smoke e2e on Bitrise team-mobile-platform
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Intermittent yarn setup failure
4 participants