Skip to content

fix(tests): Use a file lock as well as a mutex to isolate tests cases#6508

Merged
TomAFrench merged 1 commit intomasterfrom
fix-test-matrix-mutex
Nov 13, 2024
Merged

fix(tests): Use a file lock as well as a mutex to isolate tests cases#6508
TomAFrench merged 1 commit intomasterfrom
fix-test-matrix-mutex

Conversation

@aakoshh
Copy link
Copy Markdown
Contributor

@aakoshh aakoshh commented Nov 13, 2024

Description

Problem*

The test matrix added in #6429 still causes EOF failures on CI despite #6455 adding a Mutex. This is probably because on CI we use cargo nextest, which runs tests in separate processes (also separate machines because of --partition and matrix, but that shouldn't result in conflicts).

Summary*

Adds a file lock on the Nargo.toml file to coordinate which process is running a specific test.

Additional Context

In my local testing with cargo test -p nargo_cli --test execute the file lock alone wasn't enough, there was always 1 or 2 failures out of the 1600 or so tests, so I left the Mutex in place. Come to think of it, cargo test runs all tests in the same process, so from a POSIX perspective it already has the lock, and when it asks again it doesn't run into conflicts.

Documentation*

Check one:

  • No documentation needed.
  • Documentation included in this PR.
  • [For Experimental Features] Documentation to be submitted in a separate PR.

PR Checklist*

  • I have tested the changes locally.
  • I have formatted the changes with Prettier and/or cargo fmt on default settings.

Loading
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.

3 participants