Skip to content

Commit

Permalink
fix: Fix intermittent install failures (#9343)
Browse files Browse the repository at this point in the history
<!--
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**

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

- [x] I’ve followed [MetaMask Coding
Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.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-mobile/blob/main/.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.
  • Loading branch information
Gudahtt authored Apr 22, 2024
1 parent 933b43b commit cd81b17
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion scripts/setup.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ const tasks = new Listr([
],
{
exitOnError: true,
concurrent: true,
concurrent: false,
});

await tasks.run();
Expand Down

0 comments on commit cd81b17

Please sign in to comment.