Skip to content

Commit bc5083f

Browse files
ivmaykovanmolnar
authored andcommitted
ZOOKEEPER-3276: Make X509UtilTest.testCreateSSLServerSocketWithPort less flaky
Pick the free port right before using it, so there is less time for another thread/process to grab it from under us. Author: Ilya Maykov <[email protected]> Reviewers: [email protected] Closes apache#816 from ivmaykov/ZOOKEEPER-3276
1 parent af8ba12 commit bc5083f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

zookeeper-server/src/test/java/org/apache/zookeeper/common/X509UtilTest.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -192,8 +192,8 @@ public void testCreateSSLServerSocketWithoutPort() throws Exception {
192192

193193
@Test(timeout = 5000)
194194
public void testCreateSSLServerSocketWithPort() throws Exception {
195-
int port = PortAssignment.unique();
196195
setCustomCipherSuites();
196+
int port = PortAssignment.unique();
197197
SSLServerSocket sslServerSocket = x509Util.createSSLServerSocket(port);
198198
Assert.assertEquals(sslServerSocket.getLocalPort(), port);
199199
Assert.assertArrayEquals(customCipherSuites, sslServerSocket.getEnabledCipherSuites());

0 commit comments

Comments
 (0)