RFR: 8295798: (ch) Test java/nio/channels/Channels/ReadXBytes.java is very slow on Windows

Daniel Jeliński djelinski at openjdk.org
Mon Oct 24 12:44:35 UTC 2022


Please review this PR that reduces the number of bytes written by ReadXBytes test on machines supporting sparse files.

Before this change the `createFileWithRandomContent` function would usually write either the last byte only, or the entire file (`long p` was usually set to length - 1). Now the function only writes the first and the last 32kB, and the remaining bytes are initialized in platform-defined manner.

Before this change the test took between 1-10 minutes to complete on our Windows CI machines.
After this change the test finishes in less than 1 minute.

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

Commit messages:
 - Speed up file creation

Changes: https://git.openjdk.org/jdk/pull/10834/files
 Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=10834&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8295798
  Stats: 22 lines in 1 file changed: 5 ins; 0 del; 17 mod
  Patch: https://git.openjdk.org/jdk/pull/10834.diff
  Fetch: git fetch https://git.openjdk.org/jdk pull/10834/head:pull/10834

PR: https://git.openjdk.org/jdk/pull/10834


More information about the nio-dev mailing list