Selaa lähdekoodia

ZOOKEEPER-1357. Zab1_0Test uses hard-wired port numbers. Specifically, it uses the same port for leader in two different tests. The second test periodically fails complaining that the port is still in use. (Alexander Shraer via michim)

git-svn-id: https://svn.apache.org/repos/asf/zookeeper/trunk@1587335 13f79535-47bb-0310-9956-ffa450edef68
Michi Mutsuzaki 11 vuotta sitten
vanhempi
commit
f7c4e5aae7
2 muutettua tiedostoa jossa 13 lisäystä ja 9 poistoa
  1. 4 0
      CHANGES.txt
  2. 9 9
      src/java/test/org/apache/zookeeper/server/quorum/Zab1_0Test.java

+ 4 - 0
CHANGES.txt

@@ -601,6 +601,10 @@ BUGFIXES:
 
   ZOOKEEPER-1897. ZK Shell/Cli not processing commands (stack via michim)
 
+  ZOOKEEPER-1357. Zab1_0Test uses hard-wired port numbers. Specifically, it uses
+  the same port for leader in two different tests. The second test periodically
+  fails complaining that the port is still in use. (Alexander Shraer via michim)
+
 IMPROVEMENTS:
 
   ZOOKEEPER-1170. Fix compiler (eclipse) warnings: unused imports,

+ 9 - 9
src/java/test/org/apache/zookeeper/server/quorum/Zab1_0Test.java

@@ -1293,17 +1293,17 @@ public class Zab1_0Test {
         peer.tickTime = 2000;
         
         peers.put(0L, new QuorumServer(
-            0, new InetSocketAddress("127.0.0.1", 33221),
-               new InetSocketAddress("127.0.0.1", 33231),
-               new InetSocketAddress("127.0.0.1", 33241)));
+            0, new InetSocketAddress("127.0.0.1", PortAssignment.unique()),
+               new InetSocketAddress("127.0.0.1", PortAssignment.unique()),
+               new InetSocketAddress("127.0.0.1", PortAssignment.unique())));
         peers.put(1L, new QuorumServer(
-            1, new InetSocketAddress("127.0.0.1", 33223),
-               new InetSocketAddress("127.0.0.1", 33233),
-               new InetSocketAddress("127.0.0.1", 33243)));
+            1, new InetSocketAddress("127.0.0.1", PortAssignment.unique()),
+               new InetSocketAddress("127.0.0.1", PortAssignment.unique()),
+               new InetSocketAddress("127.0.0.1", PortAssignment.unique())));
         peers.put(2L, new QuorumServer(
-            2, new InetSocketAddress("127.0.0.1", 33224),
-               new InetSocketAddress("127.0.0.1", 33234),
-               new InetSocketAddress("127.0.0.1", 33245)));
+            2, new InetSocketAddress("127.0.0.1", PortAssignment.unique()),
+               new InetSocketAddress("127.0.0.1", PortAssignment.unique()),
+               new InetSocketAddress("127.0.0.1", PortAssignment.unique())));
         
         peer.setQuorumVerifier(new QuorumMaj(peers), false);
         peer.setCnxnFactory(new NullServerCnxnFactory());