[ https://issues.apache.org/jira/browse/ZOOKEEPER-1578?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13505405#comment-13505405 ]
Li Ping Zhang commented on ZOOKEEPER-1578: ------------------------------------------ This 1 UT failure org.apache.zookeeper.server.quorum.Zab1_0Test is not only existed in Open JDK, but also exsited in SUN JDK. This is due to this test uses a lot of hard-wired port numbers. Most or all other tests automatically assign a free port. The resolvement is to modify org.apache.zookeeper.server.quorum.Zab1_0Test, specifying a different port instead of the 33556 or just change it to PortAssignment.unique() and add "import org.apache.zookeeper.PortAssignment;". > org.apache.zookeeper.server.quorum.Zab1_0Test failed due to hard code with > 33556 port > ------------------------------------------------------------------------------------- > > Key: ZOOKEEPER-1578 > URL: https://issues.apache.org/jira/browse/ZOOKEEPER-1578 > Project: ZooKeeper > Issue Type: Bug > Affects Versions: 3.4.3 > Reporter: Li Ping Zhang > Labels: patch > Original Estimate: 24h > Remaining Estimate: 24h > > org.apache.zookeeper.server.quorum.Zab1_0Test was failed both with SUN JDK > and open JDK. > [junit] Running org.apache.zookeeper.server.quorum.Zab1_0Test > [junit] Tests run: 8, Failures: 0, Errors: 1, Time elapsed: 18.334 sec > [junit] Test org.apache.zookeeper.server.quorum.Zab1_0Test FAILED > Zab1_0Test log: > Zab1_0Test log: > 2012-07-11 23:17:15,579 [myid:] - INFO [main:Leader@427] - Shutdown called > java.lang.Exception: shutdown Leader! reason: end of test > at org.apache.zookeeper.server.quorum.Leader.shutdown(Leader.java:427) > at > org.apache.zookeeper.server.quorum.Zab1_0Test.testLastAcceptedEpoch(Zab1_0Test.java:211) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:48) > 2012-07-11 23:17:15,584 [myid:] - ERROR [main:Leader@139] - Couldn't bind to > port 33556 > java.net.BindException: Address already in use > at java.net.PlainSocketImpl.bind(PlainSocketImpl.java:402) > at java.net.ServerSocket.bind(ServerSocket.java:328) > at java.net.ServerSocket.bind(ServerSocket.java:286) > at org.apache.zookeeper.server.quorum.Leader.<init>(Leader.java:137) > at > org.apache.zookeeper.server.quorum.Zab1_0Test.createLeader(Zab1_0Test.java:810) > at > org.apache.zookeeper.server.quorum.Zab1_0Test.testLeaderInElectingFollowers(Zab1_0Test.java:224) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > 2012-07-11 23:17:20,202 [myid:] - ERROR > [LearnerHandler-bdvm039.svl.ibm.com/9.30.122.48:40153:LearnerHandler@559] - > Unex > pected exception causing shutdown while sock still open > java.net.SocketTimeoutException: Read timed out > at java.net.SocketInputStream.read(SocketInputStream.java:129) > at java.io.BufferedInputStream.fill(BufferedInputStream.java:218) > at java.io.BufferedInputStream.read(BufferedInputStream.java:237) > at java.io.DataInputStream.readInt(DataInputStream.java:370) > at > org.apache.jute.BinaryInputArchive.readInt(BinaryInputArchive.java:63) > at > org.apache.zookeeper.server.quorum.QuorumPacket.deserialize(QuorumPacket.java:83) > at > org.apache.jute.BinaryInputArchive.readRecord(BinaryInputArchive.java:108) > at > org.apache.zookeeper.server.quorum.LearnerHandler.run(LearnerHandler.java:291) > 2012-07-11 23:17:20,203 [myid:] - WARN > [LearnerHandler-bdvm039.svl.ibm.com/9.30.122.48:40153:LearnerHandler@569] - > **** > *** GOODBYE bdvm039.svl.ibm.com/9.30.122.48:40153 ******** > 2012-07-11 23:17:20,204 [myid:] - INFO [Thread-20:Leader@421] - Shutting down > 2012-07-11 23:17:20,204 [myid:] - INFO [Thread-20:Leader@427] - Shutdown > called > java.lang.Exception: shutdown Leader! reason: lead ended > this failure seems 33556 port is already used, but it is not in use with > command check in fact. There is a hard code in unit test, we can improve it > with code patch. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira