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
JDK-8232092 (fs) Files::isWritable returns false on a writeable root directory (win) #287
Conversation
Hi @nhat-nguyen, welcome to this OpenJDK project and thanks for contributing! We do not recognize you as Contributor and need to ensure you have signed the Oracle Contributor Agreement (OCA). If you have not signed the OCA, please follow the instructions. Please fill in your GitHub username in the "Username" field of the application. Once you have signed the OCA, please let us know by writing If you already are an OpenJDK Author, Committer or Reviewer, please click here to open a new issue so that we can record that fact. Please use "Add GitHub user nhat-nguyen" as summary for the issue. If you are contributing this work on behalf of your employer and your employer has signed the OCA, please let us know by writing |
/covered |
@nhat-nguyen The following label will be automatically applied to this pull request: When this pull request is ready to be reviewed, an RFR email will be sent to the corresponding mailing list. If you would like to change these labels, use the |
Thank you! Please allow for a few business days to verify that your employer has signed the OCA. Also, please note that pull requests that are pending an OCA check will not usually be evaluated, so your patience is appreciated! |
Webrevs
|
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.
The update to WindowsFileStore looks okay.
The test has good coverage but I worry that creating X: will not be reliable in some CI environments, esp. if X: exists already or permissions are needed. I'll try your test in our CI and would be good if others did the same.
One terminology nit is that the file system API uses the term "directory". The test uses a mix of "directory" and "folder" would be good to keep it consistent if possible.
I don't think the addition to TestUtil is needed, the createRootTempDirectory method can call Files.createTmpDirectory.
Many of the existing TestNG tests import statically Asserts and could be done here too.
substList should return Stream, we try to avoid raw types.
No need to import java.lang.ProcessBuilder, also would be good to clean import the imports, no need for a space between each java.* package.
Mailing list message from Alan Bateman on nio-dev: On 24/09/2020 10:52, Alan Bateman wrote:
I tried it in our CI and testRealPath fails consistently on all Windows -Alan |
Thank you Alan for catching this. This is an oversight on my end. I wrote
Fixed!
Fixed!
Fixed!
Fixed!
I'm sorry I'm a bit confused by this. Did you mean to say "should not return stream"? substList returns Stream and not raw Stream. If the convention is try not to return Stream<> at all, I have converted the method to return List<> instead (I made substList return Stream in the first place because I wanted to call anyMatch() on the return result). Please let me know if this is what you expected. 😄 |
Mailing list message from Alan Bateman on nio-dev: On 05/10/2020 20:02, Nhat Nguyen wrote:
My comment wasn't clear. I was pointing to the return type of substList. -Alan |
The updated test looks much better and passes in our infrastructure since the remove of the toRealPath test. I'm still bothered by the hardcoded "X:". Does subst (and hence substCreate) fail if that volume already exists? substList can be changed to return List. |
subst will fail if that volume already exists. I have added a method to find any available drive to be used with subst; it simply tries calling substCreate with drive letters from Z down to A. If none is available, it will throw a SkipException to skip the whole suite.
What is your opinion on substList returning Stream like you mentioned before? I think it is perhaps cleaner than List because I would call .anyMatch() which is a stream API on the return value of substList. |
I see the latest version will attempt to find an unused driver letter. I'll try that out now in our infrastructure to make sure that it is stable (Update: It passes on our infrastructure as it always find an unused drive so I think this aspect of the patch is good). substList returning a Stream is good but it should be Stream rather than just "Stream". Also the method name and comment suggests is returns a List, maybe it should just be renamed to mappedDrives to be a bit clearer. The new findAvailableDrive is also missing the type variable, I think you want Optional here. |
Thanks Alan for the feedback. I think there's a problem with how webrevs are being generated. I have been a bit confused by your comments on the usage of raw types because I actually have them from the beginning. I just double checked the webrevs and they are indeed missing. However, if you look at the Github diff, you will see that I'm using both |
Indeed, it seems to be interpreting the tags as if they are HTML so looked to me that you were using raw types everyone. Sorry I didn't notice this. The updated changes look good and happy to sponsor. |
@nhat-nguyen This change now passes all automated pre-integration checks. ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details. After integration, the commit message for the final commit will be:
You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed. At the time when this comment was updated there had been 321 new commits pushed to the
As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details. As you do not have Committer status in this project an existing Committer must agree to sponsor your change. Possible candidates are the reviewers of this PR (@AlanBateman) but any other Committer may sponsor as well. ➡️ To flag this PR as ready for integration with the above commit message, type |
Thank you for all the suggestions! |
/integrate |
@nhat-nguyen |
/sponsor |
@AlanBateman @nhat-nguyen Since your change was applied there have been 322 commits pushed to the
Your commit was automatically rebased without conflicts. Pushed as commit abe2593. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
Wohoo! Next Windows-related bug down. |
Mailing list message from Alan Bateman on nio-dev: Nhat, The test is failing intermittently, tracked as JDK-8254195. I didn't see I think the issue is that there are several tests running at the same -Alan [1] https://bugs.openjdk.java.net/browse/JDK-8254195 |
I'm following up on the reviewing thread here: https://mail.openjdk.java.net/pipermail/nio-dev/2020-August/007456.html
All the tests that create symlinks are now properly checked against using
TestUtil.supportsLinks
Progress
Issue
Reviewers
Download
$ git fetch https://git.openjdk.java.net/jdk pull/287/head:pull/287
$ git checkout pull/287