Conversation
fae8a88 to
398826a
Compare
That's easier to write and test and makes the api surface of the private module a bit smaller.
398826a to
30540f7
Compare
When multiple processes are racing to create the next testdir, as is the case with cargo-nextest, a process might encounter a a numbered dir with no cargo-pid file present. Previously it would assume this directory can not be used and create the next one. Which results in cargo-nextest creating directories per thread, often deleting some earlier testdirs that are being used by the same testrun. By waiting a little for the pidfile to appear we can avoid this and do correctly reuse the directory. If two processes create the same numbered dir concurrently this will be fine, since only one will create the cargo-pid file or they will create the same cargo-pid file. Fixes #17.
If multiple test runs are started at virutally the same time they could accidentally start using the same testdir. This protects against this by making sure to not overwrite a pidfile and check if the correct pid is inside. If it is not, then it tries again.
f45d51e to
8435461
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
Uh oh!
There was an error while loading. Please reload this page.