-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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-8327474 Review use of java.io.tmpdir in jdk tests #18352
Conversation
👋 Welcome back bhuang! A progress list of the required criteria for merging this PR into |
@bwhuang-us 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 254 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. ➡️ To integrate this PR with the above commit message to the |
@bwhuang-us The following labels 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 lists. If you would like to change these labels, use the /label pull request command. |
Webrevs
|
Speaking for JFR, we should probably just create a normal file, possibly with a filename to indicate subtest and iteration. That said, test changes for JFR looks fine, and fixing the filename is outside the scope of this bug. |
test/jdk/com/sun/management/HotSpotDiagnosticMXBean/CheckOrigin.java
Outdated
Show resolved
Hide resolved
The bug should have a |
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.
unixdomain NIO test changes look fine to me
Co-authored-by: Andrey Turbanov <turbanoff@gmail.com>
SocketChannel socketChannel = serverSocketChannel.accept(); | ||
System.out.println("The socketChannel is : expected Null " + socketChannel); | ||
if (socketChannel != null) | ||
throw new RuntimeException("expected null"); | ||
// or exception could be thrown otherwise | ||
} finally { | ||
Files.deleteIfExists(addr.getPath()); |
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.
Hello Bill, addr
can be null
here, so this has a potential of a NullPointerException
.
@@ -66,6 +66,7 @@ private void run(String keystoreType, String algName, int keySize) throws Except | |||
ks.setEntry(ALIAS, ske, kspp); | |||
|
|||
File ksFile = File.createTempFile("test", ".test"); | |||
ksFile.deleteOnExit(); |
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.
Is there a reason why this change is done differently than the rest of the changes in this PR? Can we delete the File
in a try/finally instead of enrolling a shutdown hook to delete it?
For the changes in |
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.
Thank you for the update, Bill. The latest changes look OK to me.
I also heard from Bill that Alan has approved the changes too.
Before integrating, please run tier1, tier2 and tier3 (I haven't checked which tiers these changed tests belong to) to make sure nothing breaks unexpectedly.
/integrate |
Going to push as commit 375bfac.
Your commit was automatically rebased without conflicts. |
@bwhuang-us Pushed as commit 375bfac. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
This task addresses an essential aspect of our testing infrastructure: the proper handling and cleanup of temporary files and socket files created during test execution. The motivation behind these changes is to prevent the accumulation of unnecessary files in the default temporary directory, which can affect the system's storage and potentially influence subsequent test runs.
Our review identified that several tests create temporary files or socket files without ensuring their removal post-execution.
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/18352/head:pull/18352
$ git checkout pull/18352
Update a local copy of the PR:
$ git checkout pull/18352
$ git pull https://git.openjdk.org/jdk.git pull/18352/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 18352
View PR using the GUI difftool:
$ git pr show -t 18352
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/18352.diff
Webrev
Link to Webrev Comment