RFR: 8301214: Adjust handshakeTimeout value in test HandshakeTimeout.java after 8189338 [v2]

Daniel Jeliński djelinski at openjdk.org
Tue Feb 7 10:02:55 UTC 2023


On Tue, 7 Feb 2023 09:38:13 GMT, Daniel Jeliński <djelinski at openjdk.org> wrote:

>> Please review this patch that reduces the socket timeout used in HandshakeTimeout test to its minimum value of 1 millisecond.
>> 
>> This change makes the test complete 10 seconds faster; before this change it took 5 seconds for the handshake to timeout, and the test attempts 2 handshakes.
>> 
>> The change also makes the test more likely to pass when it has to compete with other tests for CPU time.
>
> Daniel Jeliński has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains three additional commits since the last revision:
> 
>  - Restructure test
>  - Merge remote-tracking branch 'origin' into rmi-test-timeout
>  - Reduce socket timeout

The original motivation to touch this test was that the SSL version timed out; the handshake timeout was too long in proportion to the test timeout, which was fixed at 10 seconds (see `TIMEOUT` constant).
The `sun.rmi.transport.tcp.handshakeTimeout` property only applies to a single network operation in the current implementation. SSL part of the handshake (client hello/key share generation) does not count towards the timeout, and if there are multiple network operations (e.g. when doing SSL handshake we first write to the socket, then read from it), each operation can use the full timeout value.

The purpose of this test is to verify that the handshake does not block forever (JDK-4322806 was for plain handshake, JDK-8189338 was for SSL handshake). After my changes the test still does that; without the fixes for the above bugs, the test times out.

Thanks for the restructuring suggestion. I modified the test to run in a single thread. Test timeout is now handled by JTReg timeout handler, which means that 1) we will have a thread dump when that happens, 2) timeout factor will be used in timeout calculations.

Let me know if that addresses your concerns.

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

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


More information about the core-libs-dev mailing list