Avoid a race condition in test/jdk/sun/security/ssl/SSLSocketImpl/InvalidateServerSessionRenegotiate.java. The HandshakeCompletedListener is invoked asynchronously, but the test only uses a fixed Thread.sleep(1000) before checking the completion count. Under load or slow systems, one or both listener callbacks could arrive after the sleep expired, causing a spurious failure even though the handshakes completed successfully. Use a CountDownLatch to avoid this.
--------- - [x] I confirm that I make this contribution in accordance with the [OpenJDK Interim AI Policy](https://openjdk.org/legal/ai). ------------- Commit messages: - Increase Timeout - Use a CountDownLatch - Change sleep to waits with bigger overall timeout Changes: https://git.openjdk.org/jdk/pull/32834/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=32834&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8392076 Stats: 13 lines in 1 file changed: 3 ins; 4 del; 6 mod Patch: https://git.openjdk.org/jdk/pull/32834.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/32834/head:pull/32834 PR: https://git.openjdk.org/jdk/pull/32834
