-
Notifications
You must be signed in to change notification settings - Fork 71
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
ignore missing files when deleting TempDirectory #140
ignore missing files when deleting TempDirectory #140
Conversation
Please note that the Also, a similar bug was fixed in junit-team/junit5#1801. Though, your proposed fixed adds a check on a per-file level. Perhaps you'd like to propose that particular fix for JUnit Jupiter? |
Since Pioneer's extension is not yet deprecated (and #136 makes it look like it may survive for the time being) I'm going to rebase and merge this. |
5621956
to
b7abcc3
Compare
Files.delete(path); | ||
// without races by multiple threads, a call to `Files::delete` would suffice | ||
// because the tree walker doesn't visit non-existing files; since race | ||
// conditions can't be ruled out, `Files::deleteIfExists` is the safer approach | ||
Files.deleteIfExists(path); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wondered about this change and tried to write a test for it, but couldn't. In the end, I came up with the explanation the comment describes. Would be nice of somebody could sanity-check it.
.toArray(DiscoverySelector[]::new); | ||
//@formatter:on | ||
LauncherDiscoveryRequest request = request().selectors(selectors).build(); | ||
return executeTests(request); | ||
} | ||
|
||
private MethodSelector selectMethodWithPossibleParameters(Class<?> type, String methodSignature) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could this be interesting for the Jupiter test superclass? It makes it easier to launch a bunch of tests methods if they have parameters. Nota bene: I also wondered whether Jupiter could be a little more lenient and select a test method by name only (i.e. ignoring parameter types) if there is only one method of that name.
b7abcc3
to
a59ca03
Compare
Proposed commit message:
|
I've got an exception when TempDirectory was deleting its contents because one of the files has been deleted at the same time by the process started from test.
I think such disappearing files should be ignored by TempDirectory.
I hereby agree to the terms of the JUnit Pioneer Contributor License Agreement.