Skip to content

fix(ci): fix flaky yarn install in lint-and-build-ctst job#2368

Merged
bert-e merged 1 commit intodevelopment/2.14from
bugfix/ZENKO-5246/fix-flaky-yarn-install
Mar 27, 2026
Merged

fix(ci): fix flaky yarn install in lint-and-build-ctst job#2368
bert-e merged 1 commit intodevelopment/2.14from
bugfix/ZENKO-5246/fix-flaky-yarn-install

Conversation

@delthas
Copy link
Copy Markdown
Contributor

@delthas delthas commented Mar 26, 2026

Summary

The lint-and-build-ctst job intermittently fails during yarn install with a corrupt cache error (example failure):

error https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.1.tgz: Extracting tar content of undefined failed,
the file appears to be corrupt: "ENOENT: no such file or directory, chmod
'/home/runner/.cache/yarn/v6/npm-picomatch-2.3.1-...-integrity/node_modules/picomatch/package.json'"

Root cause

Yarn v1 fetches and extracts packages in parallel by default. This can cause a race condition where concurrent tar extractions corrupt files in the local cache directory. Once a corrupted entry is written, the actions/setup-node cache action persists it to the GitHub Actions cache, causing subsequent workflow runs to restore the bad state and fail deterministically until the cache key rotates.

Solution

Two complementary mitigations:

  1. --network-concurrency 1 — serializes package fetching and extraction, preventing the race condition that causes corruption in the first place. This is the primary fix; the slight increase in install time is negligible compared to the cost of flaky CI reruns.

  2. || (yarn cache clean && yarn install --network-concurrency 1) — if the cache is already corrupt from a previous run, the first yarn install fails, the fallback wipes the local cache, and the retry succeeds with a clean slate. This handles the transitional period until all runners pick up a fresh cache.

Fixes ZENKO-5246

Yarn v1's default parallel fetching can race during tar extraction,
corrupting packages in the cache. Add --network-concurrency 1 to
serialize fetching, and a cache clean + retry fallback for caches
that are already corrupt.

Issue: ZENKO-5246
@bert-e
Copy link
Copy Markdown
Contributor

bert-e commented Mar 26, 2026

Hello delthas,

My role is to assist you with the merge of this
pull request. Please type @bert-e help to get information
on this process, or consult the user documentation.

Available options
name description privileged authored
/after_pull_request Wait for the given pull request id to be merged before continuing with the current one.
/bypass_author_approval Bypass the pull request author's approval
/bypass_build_status Bypass the build and test status
/bypass_commit_size Bypass the check on the size of the changeset TBA
/bypass_incompatible_branch Bypass the check on the source branch prefix
/bypass_jira_check Bypass the Jira issue check
/bypass_peer_approval Bypass the pull request peers' approval
/bypass_leader_approval Bypass the pull request leaders' approval
/approve Instruct Bert-E that the author has approved the pull request. ✍️
/create_pull_requests Allow the creation of integration pull requests.
/create_integration_branches Allow the creation of integration branches.
/no_octopus Prevent Wall-E from doing any octopus merge and use multiple consecutive merge instead
/unanimity Change review acceptance criteria from one reviewer at least to all reviewers
/wait Instruct Bert-E not to run until further notice.
Available commands
name description privileged
/help Print Bert-E's manual in the pull request.
/status Print Bert-E's current status in the pull request TBA
/clear Remove all comments from Bert-E from the history TBA
/retry Re-start a fresh build TBA
/build Re-start a fresh build TBA
/force_reset Delete integration branches & pull requests, and restart merge process from the beginning.
/reset Try to remove integration branches unless there are commits on them which do not appear on the source branch.

Status report is not available.

@bert-e
Copy link
Copy Markdown
Contributor

bert-e commented Mar 26, 2026

Waiting for approval

The following approvals are needed before I can proceed with the merge:

  • the author

  • 2 peers

@delthas delthas requested review from a team, DarkIsDude, SylvainSenechal, benzekrimaha and francoisferrand and removed request for DarkIsDude and benzekrimaha March 27, 2026 08:12
@francoisferrand
Copy link
Copy Markdown
Contributor

francoisferrand commented Mar 27, 2026

Looking at yarn tickets, it seems this may not be the root cause: c.f. yarnpkg/yarn#7212 (comment) for exemple
→ there may be some issues in our dependency tree instead, we should probably look there (as well and/or in addition)...

@delthas
Copy link
Copy Markdown
Contributor Author

delthas commented Mar 27, 2026

/approve

@bert-e
Copy link
Copy Markdown
Contributor

bert-e commented Mar 27, 2026

I have successfully merged the changeset of this pull request
into targetted development branches:

  • ✔️ development/2.14

The following branches have NOT changed:

  • development/2.10
  • development/2.11
  • development/2.12
  • development/2.13
  • development/2.5
  • development/2.6
  • development/2.7
  • development/2.8
  • development/2.9

Please check the status of the associated issue ZENKO-5246.

Goodbye delthas.

The following options are set: approve

@bert-e bert-e merged commit b7abbdf into development/2.14 Mar 27, 2026
26 of 28 checks passed
@bert-e bert-e deleted the bugfix/ZENKO-5246/fix-flaky-yarn-install branch March 27, 2026 09:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants