RFR: 8276994: java/nio/channels/Channels/TransferTo.java leaves multi-GB files in /tmp

Lance Andersen lancea at openjdk.java.net
Sun Nov 14 15:11:39 UTC 2021


On Sun, 14 Nov 2021 14:38:46 GMT, Markus KARG <duke at openjdk.java.net> wrote:

>> test/jdk/java/nio/channels/Channels/TransferTo.java line 147:
>> 
>>> 145:     @Test
>>> 146:     public void testMoreThanTwoGB() throws IOException {
>>> 147:         // preparing two temporary files which will be compared at the end of the test
>> 
>> I would prefer to keep the previous changes to this test.  We went through a few iterations off line.  We would also prefer to delete these files at the end of the test, not just the over all test run due to their size.
>
> As all the *other* tests in this test class run rather quick (within seconds) I wonder what you expect to *actually* gain? The difference would just be some seconds of earlier deletion for the sake of worse readability, actually. If the majority is for keeping your original solution, this is fine for me. I just like to understand the driver behind this.

In the unlikely event there is an error, we can uniquely identify which file is left around more easily.  Your proposed change ignores the IOException completely.

Given the size of the files, best to clean up before existing the test method.

-------------

PR: https://git.openjdk.java.net/jdk/pull/6379


More information about the nio-dev mailing list