RFR: 8276763: java/nio/channels/SocketChannel/AdaptorStreams.java fails with "SocketTimeoutException: Read timed out"

Alan Bateman alanb at openjdk.java.net
Thu Nov 11 14:11:50 UTC 2021


test/jdk/java/nio/channels/SocketChannel/AdaptorStreams.java tests SocketChannel's socket adaptor. Two of tests, testTimedRead1 and testTimedRead2 have relatively short timeouts which can cause the test to fail if the VM is paused or the machine is hung/overloaded for more than a few seconds. I've changed the timeout used by the two tests to 60s. This change does not impact the duration of the test because the reads do not timeout.

In passing, I've changed testTimedRead3 to use a timeout of 500ms, it is expected to throw SocketTimeoutException, and replaced setSoTimeout(60*1000) with setSoTimeout(60_000) in several other tests.

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

Commit messages:
 - Bump timeout for tests that don't expect SocketTimeoutException

Changes: https://git.openjdk.java.net/jdk/pull/6351/files
 Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=6351&range=00
  Issue: https://bugs.openjdk.java.net/browse/JDK-8276763
  Stats: 10 lines in 1 file changed: 0 ins; 0 del; 10 mod
  Patch: https://git.openjdk.java.net/jdk/pull/6351.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/6351/head:pull/6351

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


More information about the nio-dev mailing list