fix(tests): Use a file lock as well as a mutex to isolate tests cases#6508
Merged
TomAFrench merged 1 commit intomasterfrom Nov 13, 2024
Merged
fix(tests): Use a file lock as well as a mutex to isolate tests cases#6508TomAFrench merged 1 commit intomasterfrom
TomAFrench merged 1 commit intomasterfrom
Conversation
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 usecargo nextest, which runs tests in separate processes (also separate machines because of--partitionandmatrix, but that shouldn't result in conflicts).Summary*
Adds a file lock on the
Nargo.tomlfile to coordinate which process is running a specific test.Additional Context
In my local testing with
cargo test -p nargo_cli --test executethe file lock alone wasn't enough, there was always 1 or 2 failures out of the 1600 or so tests, so I left theMutexin place. Come to think of it,cargo testruns 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:
PR Checklist*
cargo fmton default settings.