[ https://issues.apache.org/jira/browse/ZOOKEEPER-2664?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15821830#comment-15821830 ]
Edward Ribeiro commented on ZOOKEEPER-2664: ------------------------------------------- Hi [~tedyu], Thanks for the patch! :) The ZK project is switching to a Github based workflow so that it can be easier for contributors to submit PR and reviewers to take a look at the patch. Would you mind to submit a PR for this issue? your PR title should start as "ZOOKEEPER-2664:" so that it can automatically be linked to this JIRA issue. More details here under 'Pull requests via github (work in progress)' here https://cwiki.apache.org/confluence/display/ZOOKEEPER/HowToContribute Secondly, this issue is a duplicate of https://issues.apache.org/jira/browse/ZOOKEEPER-2395 , I am marking it as so, but leave to [~phunt] to decide which one to keep and which one to close, but merging the comments & proposed solutions from both, of course. Thirdly, I couldn't patch the file using both commands below. Are you sure you generated the patch with the command like: {{git diff --no-prefix previous_commit..your_commit > ZOOKEEPER-2664.patch}} ? Finally, would you mind to LOG a WARN message inside the catch block so that whoever looks at the log knows that this test was skipped because it had trouble finding the loopback interface? Thanks > ClientPortBindTest#testBindByAddress may fail due to "No such device" > exception > ------------------------------------------------------------------------------- > > Key: ZOOKEEPER-2664 > URL: https://issues.apache.org/jira/browse/ZOOKEEPER-2664 > Project: ZooKeeper > Issue Type: Test > Affects Versions: 3.4.6 > Reporter: Ted Yu > Assignee: Ted Yu > Attachments: ZOOKEEPER-2664.v1.txt > > > Saw the following in a recent run: > {code} > Stacktrace > java.net.SocketException: No such device > at java.net.NetworkInterface.isLoopback0(Native Method) > at java.net.NetworkInterface.isLoopback(NetworkInterface.java:390) > at > org.apache.zookeeper.test.ClientPortBindTest.testBindByAddress(ClientPortBindTest.java:61) > at > org.apache.zookeeper.JUnit4ZKTestRunner$LoggedInvokeMethod.evaluate(JUnit4ZKTestRunner.java:52) > Standard Output > 2017-01-12 23:20:43,792 [myid:] - INFO [main:ZKTestCase$1@50] - STARTING > testBindByAddress > 2017-01-12 23:20:43,795 [myid:] - INFO > [main:JUnit4ZKTestRunner$LoggedInvokeMethod@50] - RUNNING TEST METHOD > testBindByAddress > 2017-01-12 23:20:43,799 [myid:] - INFO > [main:JUnit4ZKTestRunner$LoggedInvokeMethod@62] - TEST METHOD FAILED > testBindByAddress > java.net.SocketException: No such device > at java.net.NetworkInterface.isLoopback0(Native Method) > at java.net.NetworkInterface.isLoopback(NetworkInterface.java:390) > at > org.apache.zookeeper.test.ClientPortBindTest.testBindByAddress(ClientPortBindTest.java:61) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) > at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) > at java.lang.reflect.Method.invoke(Method.java:601) > at > org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44) > at > org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15) > at > org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41) > at > org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20) > at > org.apache.zookeeper.JUnit4ZKTestRunner$LoggedInvokeMethod.evaluate(JUnit4ZKTestRunner.java:52) > at org.junit.rules.TestWatchman$1.evaluate(TestWatchman.java:48) > at > org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:76) > at > org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50) > at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193) > at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52) > at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191) > at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42) > at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184) > at org.junit.runners.ParentRunner.run(ParentRunner.java:236) > at junit.framework.JUnit4TestAdapter.run(JUnit4TestAdapter.java:39) > at > org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.run(JUnitTestRunner.java:532) > at > org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.launch(JUnitTestRunner.java:1179) > at > org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(JUnitTestRunner.java:1030) > {code} > Proposed fix is to catch exception from isLoopback() call. -- This message was sent by Atlassian JIRA (v6.3.4#6332)