poorbarcode commented on code in PR #16152:
URL: https://github.com/apache/pulsar/pull/16152#discussion_r903196713


##########
pulsar-client/src/test/java/org/apache/pulsar/client/impl/AutoClusterFailoverTest.java:
##########
@@ -283,4 +291,46 @@ public void testAutoClusterFailoverSwitchTlsTrustStore() 
throws IOException {
                 .updateTlsTrustStorePathAndPassword(primaryTlsTrustStorePath, 
primaryTlsTrustStorePassword);
 
     }
+
+    @Test
+    public void testUrl() throws Exception {
+        Random random = new Random(42);
+        String serviceUrl = "pulsar://localhost:" + random.nextInt(65535);
+
+
+        PulsarServiceNameResolver resolver = new PulsarServiceNameResolver();
+
+        try {
+            resolver.updateServiceUrl(serviceUrl);
+            InetSocketAddress inetSocketAddress = new 
InetSocketAddress(resolver.resolveHost().getHostName(), 
resolver.resolveHost().getPort());
+            Socket socket = new Socket();
+            socket.connect(inetSocketAddress, 30);
+            socket.close();
+            fail();

Review Comment:
   > Seems this could be flaky? If the random port is open by coincidence.
   
   +1



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to