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: remove pnpm store cache loose match restore-keys #1180

Merged

Conversation

MikeMcC399
Copy link
Collaborator

@MikeMcC399 MikeMcC399 commented May 11, 2024

Issue

pnpm basic and workspaces workflows

include the use of the GitHub provided actions/cache action to cache dependencies installed by pnpm, with the input restore-keys set to a loose match in the form:

          key: ${{ runner.os }}-pnpm-store-${{ hashFiles('examples/xxx/pnpm-lock.yaml') }}
          restore-keys: |
            ${{ runner.os }}-pnpm-store-

This leads to non-deterministic outcomes of any jobs in the worksflows running on the same operating system in parallel, since the state of the GitHub caches in the branch concerned depends on the variable timing of other jobs which are running. Jobs which are exposed to this issue are:

The non-deterministic behaviour is in contrast to the cypress-io/github-action which uses exact cache key matches.

Change

Remove the option restore-keys from the workflows listed above and from the documentation examples in the README.

Correct also an error in example-start-and-pnpm-workspaces.yml where the cache was incorrectly using the lock file from examples/basic-pnpm instead of from examples/start-and-pnpm-workspaces.

Related issues

Related PRs

References

Verification

Downgrade the pnpm examples to Cypress 13.8.0

Run each workflow twice and confirm no errors.

Revert the pnpm examples to Cypress 13.9.0 and again run each workflow twice with no errors.

@cypress-app-bot
Copy link

@MikeMcC399 MikeMcC399 self-assigned this May 11, 2024
@MikeMcC399 MikeMcC399 marked this pull request as ready for review May 11, 2024 14:25
@MikeMcC399 MikeMcC399 added the documentation Improvements or additions to documentation label May 11, 2024
@jennifer-shehane jennifer-shehane merged commit 1d3deeb into cypress-io:master May 13, 2024
77 checks passed
@MikeMcC399 MikeMcC399 deleted the remove/pnpm-restore-keys branch May 14, 2024 04:45
Copy link

🎉 This PR is included in version 6.7.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working ci documentation Improvements or additions to documentation released tests topic: caching 📦
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants