[
https://issues.apache.org/jira/browse/ZOOKEEPER-1256?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15368035#comment-15368035
]
Flavio Junqueira commented on ZOOKEEPER-1256:
---------------------------------------------
This test case was introduced in ZOOKEEPER-635. I think you're suggesting
something like this:
{noformat}
- String bindAddress = null;
- Enumeration<NetworkInterface> intfs =
- NetworkInterface.getNetworkInterfaces();
- // if we have a loopback and it has an address use it
- while(intfs.hasMoreElements()) {
- NetworkInterface i = intfs.nextElement();
- if (i.isLoopback()) {
- Enumeration<InetAddress> addrs = i.getInetAddresses();
- if (addrs.hasMoreElements()) {
- bindAddress = addrs.nextElement().getHostAddress();
- }
- }
- }
+ String bindAddress = InetAddress.getLoopbackAddress().getHostAddress();
+
{noformat}
As I see it, it tests what it is supposed to, which is that the server binds to
a specified port, but I'm not sure what the issue is with the IPv6 address.
> ClientPortBindTest is failing on Mac OS X
> -----------------------------------------
>
> Key: ZOOKEEPER-1256
> URL: https://issues.apache.org/jira/browse/ZOOKEEPER-1256
> Project: ZooKeeper
> Issue Type: Bug
> Components: tests
> Environment: Mac OS X
> Reporter: Daniel Gómez Ferro
> Assignee: Flavio Junqueira
> Fix For: 3.5.3, 3.6.0
>
> Attachments: ClientPortBindTest.log, ZOOKEEPER-1256.patch,
> ZOOKEEPER-1256.patch, ZOOKEEPER-1256.patch
>
>
> ClientPortBindTest is failing consistently on Mac OS X.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)