RFR: 8294437: java/nio/channels/FileChannel tests slow on Windows [v2]
Brian Burkhalter
bpb at openjdk.org
Fri Sep 30 00:08:19 UTC 2022
On Thu, 29 Sep 2022 14:30:21 GMT, Daniel Jeliński <djelinski at openjdk.org> wrote:
>> Please review this test-only change that improves the execution speed of a few FileChannel tests:
>> - Transfer2GPlus, Transfer4GBFile, and TransferTo6GBFile were modified to use sparse files. Their speed is now consistent across platforms, provided that the platform / filesystem supports sparse files.
>> - LargeMapTest was rewritten to use sparse files, and to more precisely target the issue it was written to detect. In my tests it still crashed with EXCEPTION_ACCESS_VIOLATION when JDK-8286637 was reverted.
>> - MapTest: repetition was removed from `testForce` method; I'm not sure what issues it was supposed to catch, but at far as I can tell, it was only triggering timeouts, see [JDK-8289526](https://bugs.openjdk.org/browse/JDK-8289526), [JDK-8224480](https://bugs.openjdk.org/browse/JDK-8224480)
>
> Daniel Jeliński has updated the pull request incrementally with seven additional commits since the last revision:
>
> - Remove intermittently failing deletes
> - reintroduce deleteOnExit
> - rewrite testToWritableByteChannel without using file output
> - Migrate Transfer4GBFile to nio
> - Implement createSparseTempFile
> - Use RandomFactory to generate random bytes
> - Update copyright year
test/jdk/java/nio/channels/FileChannel/Transfer4GBFile.java line 73:
> 71: StandardOpenOption.READ);
> 72: FileChannel sinkChannel = FileChannel.open(sink,
> 73: StandardOpenOption.WRITE)) {
Some weird indentation at lines 71 and 73. A static import of the `StandardOpenOption` enum onstants would help.
test/jdk/java/nio/channels/FileChannel/Transfer4GBFile.java line 116:
> 114: try (FileChannel sourceChannel = FileChannel.open(source, StandardOpenOption.READ);
> 115: FileChannel sinkChannel = FileChannel.open(sink, StandardOpenOption.WRITE)) {
> 116: long bytesWritten = sinkChannel.transferFrom(sourceChannel,
Same comment as for `FileChannel::transferTo`:
```An invocation of this method may or may not transfer all of the requested bytes```.
-------------
PR: https://git.openjdk.org/jdk/pull/10464
More information about the nio-dev
mailing list