RFR: 8276994: java/nio/channels/Channels/TransferTo.java leaves multi-GB files in /tmp
Alan Bateman
alanb at openjdk.java.net
Mon Nov 15 07:42:40 UTC 2021
On Sun, 14 Nov 2021 16:08:57 GMT, Alan Bateman <alanb at openjdk.org> wrote:
>> This PR proposes to cleanup *all* temp files of the `TransferTo` test, not just the 2GB files. Also it separates the actual test logic from the cleanup logic, so the test cases are simple to understand again as they are not interwoven with cleanup code anymore.
>
> I don't think we need this. Instead, it would be better if the tests uses the test work directory so the files are easily found for post failure analysis. This isn't practical for the tests that create >2GB files so I think leave the code that Lance put in there to delete them so they aren't archived when the work directory is zipped up.
> @AlanBateman @LanceAndersen You are confusing me. Lance requests style changes, while Alan does not want the changes. These answers are incompatible. _Either_ I change the code according Lance's wishes, _or_ we simple drop this PR. Please find a concensus.
I think it's better to pause a moment and understand the environment when jtreg runs tests. The important thing is that the current directory (as in user.dir) will be a scratch directory that jtreg has created. My comments are just pointing out that the bookkeeping proposed in this PR to delete files is not needed that you can just change the test to create the temp file in the current directory. We can leave the try-finally that Lance added in the >2GB tests because they are too big to keep for any post failure analysis.
-------------
PR: https://git.openjdk.java.net/jdk/pull/6379
More information about the nio-dev
mailing list