[ 
https://issues.apache.org/jira/browse/ZOOKEEPER-4049?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17264892#comment-17264892
 ] 

Damien Diederen commented on ZOOKEEPER-4049:
--------------------------------------------

I had a look into this.

The failing test is {{Zookeeper_simpleSystem/testIPV6}} (surprise, surprise!).

At compile time, IPv6 support for the C client is determined by the 
availability of the {{AF_INET6}} constant.  (That's Autoconf; the CMake build 
looks for {{sockaddr_in6}}.)  These tests (correctly) succeed under Docker, and 
{{ZOO_IPV6_ENABLED}} is thus set.

But now the test assumes that IPv6 is available at *runtime*​—and that isn't 
the case by default on Docker.  The 
[docs|https://docs.docker.com/config/daemon/ipv6/] say:

{quote}
Before you can use IPv6 in Docker containers or swarm services, you need to 
enable IPv6 support in the Docker daemon.
[…]
Edit /etc/docker/daemon.json, set the ipv6 key to true and the fixed-cidr-v6 
key to your IPv6 subnet.
{quote}

Changing the configuration and restarting Docker made it work for me:

{noformat}
echo '{ "ipv6": true, "fixed-cidr-v6": "****/64" }' \
  | sudo tee /etc/docker/daemon.json
{noformat}

There are two problems with that approach:

# That configuration is global; changing it may not always be possible;
# One has to provide an IPv6 subnet.

Another option would be to have a flag (environment variable?) to disable that 
specific test _at runtime_.  That would work for everybody, but would obviously 
reduce the test coverage if developers start adopting Docker.

> C client test failure on docker
> -------------------------------
>
>                 Key: ZOOKEEPER-4049
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-4049
>             Project: ZooKeeper
>          Issue Type: Bug
>    Affects Versions: 3.5.8
>            Reporter: Norbert Kalmár
>            Priority: Major
>
> A c test is constantly failing on docker environment:
> {code}
> [exec]
> /Downloads/zk359/apache-zookeeper-3.5.9/zookeeper-client/zookeeper-client-c/tests/TestClient.cc:789:
> Assertion: equality assertion failed [Expected: 0, Actual  : -4]
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to