curator git commit: enforce single thread
Repository: curator Updated Branches: refs/heads/CURATOR-265 a8ec17ece -> 2ff89856d enforce single thread Project: http://git-wip-us.apache.org/repos/asf/curator/repo Commit: http://git-wip-us.apache.org/repos/asf/curator/commit/2ff89856 Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/2ff89856 Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/2ff89856 Branch: refs/heads/CURATOR-265 Commit: 2ff89856d6ee2d373cf91bc1a3bd388890604373 Parents: a8ec17e Author: randgaltAuthored: Fri Sep 25 23:59:47 2015 -0500 Committer: randgalt Committed: Fri Sep 25 23:59:47 2015 -0500 -- pom.xml | 1 + 1 file changed, 1 insertion(+) -- http://git-wip-us.apache.org/repos/asf/curator/blob/2ff89856/pom.xml -- diff --git a/pom.xml b/pom.xml index 0e7a732..0047d96 100644 --- a/pom.xml +++ b/pom.xml @@ -622,6 +622,7 @@ org.apache.maven.plugins maven-surefire-plugin +1 false true
[7/8] curator git commit: The tests assume sequential server IDs starting at 1. Ensure this.
The tests assume sequential server IDs starting at 1. Ensure this. Project: http://git-wip-us.apache.org/repos/asf/curator/repo Commit: http://git-wip-us.apache.org/repos/asf/curator/commit/f6734ca1 Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/f6734ca1 Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/f6734ca1 Branch: refs/heads/CURATOR-3.0 Commit: f6734ca182bf2269fee6a639107872996ab3ab5c Parents: 763aa39 Author: randgaltAuthored: Fri Sep 11 12:06:18 2015 -0500 Committer: randgalt Committed: Fri Sep 11 12:06:18 2015 -0500 -- .../framework/imps/TestReconfiguration.java| 17 - 1 file changed, 12 insertions(+), 5 deletions(-) -- http://git-wip-us.apache.org/repos/asf/curator/blob/f6734ca1/curator-framework/src/test/java/org/apache/curator/framework/imps/TestReconfiguration.java -- diff --git a/curator-framework/src/test/java/org/apache/curator/framework/imps/TestReconfiguration.java b/curator-framework/src/test/java/org/apache/curator/framework/imps/TestReconfiguration.java index a99617b..2a616de 100644 --- a/curator-framework/src/test/java/org/apache/curator/framework/imps/TestReconfiguration.java +++ b/curator-framework/src/test/java/org/apache/curator/framework/imps/TestReconfiguration.java @@ -19,6 +19,7 @@ package org.apache.curator.framework.imps; +import com.google.common.collect.ImmutableList; import org.apache.curator.ensemble.EnsembleListener; import org.apache.curator.ensemble.dynamic.DynamicEnsembleProvider; import org.apache.curator.framework.CuratorFramework; @@ -64,7 +65,13 @@ public class TestReconfiguration extends BaseClassForTests @BeforeMethod public void setup() throws Exception { -cluster = new TestingCluster(5); +ImmutableList.Builder builder = ImmutableList.builder(); +for ( int i = 1; i <= 5; ++i ) +{ +builder.add(new InstanceSpec(null, -1, -1, -1, true, i, -1, -1)); +} + +cluster = new TestingCluster(builder.build()); cluster.start(); connectionString1to5 = cluster.getConnectString(); @@ -333,14 +340,14 @@ public class TestReconfiguration extends BaseClassForTests Assert.assertEquals(qv.getAllMembers().size(), 5); } -static QuorumVerifier getQuorumVerifier(byte[] bytes) throws Exception +private static QuorumVerifier getQuorumVerifier(byte[] bytes) throws Exception { Properties properties = new Properties(); properties.load(new StringReader(new String(bytes))); return new QuorumMaj(properties); } -static InstanceSpec getInstance(TestingCluster cluster, int id) +private static InstanceSpec getInstance(TestingCluster cluster, int id) { for ( InstanceSpec spec : cluster.getInstances() ) { @@ -352,7 +359,7 @@ public class TestReconfiguration extends BaseClassForTests throw new IllegalStateException("InstanceSpec with id:" + id + " not found"); } -static String getServerString(QuorumVerifier qv, TestingCluster cluster, long id) throws Exception +private static String getServerString(QuorumVerifier qv, TestingCluster cluster, long id) throws Exception { String str = qv.getAllMembers().get(id).toString(); //check if connection string is already there. @@ -366,7 +373,7 @@ public class TestReconfiguration extends BaseClassForTests } } -static String getConnectionString(TestingCluster cluster, long... ids) throws Exception +private static String getConnectionString(TestingCluster cluster, long... ids) throws Exception { StringBuilder sb = new StringBuilder(); Map specs = new HashMap<>();
[6/8] curator git commit: allow session time to elapse
allow session time to elapse Project: http://git-wip-us.apache.org/repos/asf/curator/repo Commit: http://git-wip-us.apache.org/repos/asf/curator/commit/763aa39a Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/763aa39a Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/763aa39a Branch: refs/heads/CURATOR-3.0 Commit: 763aa39a1467a6963447f7a6b0ab5ff956b1d703 Parents: a9271ff Author: randgaltAuthored: Thu Sep 10 23:43:14 2015 -0500 Committer: randgalt Committed: Thu Sep 10 23:43:14 2015 -0500 -- .../curator/framework/recipes/locks/TestInterProcessMutexBase.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/curator/blob/763aa39a/curator-recipes/src/test/java/org/apache/curator/framework/recipes/locks/TestInterProcessMutexBase.java -- diff --git a/curator-recipes/src/test/java/org/apache/curator/framework/recipes/locks/TestInterProcessMutexBase.java b/curator-recipes/src/test/java/org/apache/curator/framework/recipes/locks/TestInterProcessMutexBase.java index 0cf8d45..febf499 100644 --- a/curator-recipes/src/test/java/org/apache/curator/framework/recipes/locks/TestInterProcessMutexBase.java +++ b/curator-recipes/src/test/java/org/apache/curator/framework/recipes/locks/TestInterProcessMutexBase.java @@ -192,7 +192,7 @@ public abstract class TestInterProcessMutexBase extends BaseClassForTests Assert.assertTrue(timing.acquireSemaphore(semaphore, 1)); KillSession.kill(client.getZookeeperClient().getZooKeeper(), server.getConnectString()); -Assert.assertTrue(timing.acquireSemaphore(semaphore, 1)); + Assert.assertTrue(timing.forSessionSleep().acquireSemaphore(semaphore, 1)); } finally {
[3/8] curator git commit: wip
wip Project: http://git-wip-us.apache.org/repos/asf/curator/repo Commit: http://git-wip-us.apache.org/repos/asf/curator/commit/0603e958 Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/0603e958 Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/0603e958 Branch: refs/heads/CURATOR-3.0 Commit: 0603e95834d8596d2397620cd29235d5a62da700 Parents: fad2708 Author: randgaltAuthored: Thu Sep 10 20:43:37 2015 -0500 Committer: randgalt Committed: Thu Sep 10 20:43:37 2015 -0500 -- .../curator/framework/imps/TestFramework.java | 4 +-- .../framework/imps/TestReconfiguration.java | 3 +- .../locks/TestInterProcessMutexBase.java| 4 +-- .../curator/test/QuorumConfigBuilder.java | 36 ++-- .../curator/test/TestingZooKeeperMain.java | 18 +- .../curator/test/TestingZooKeeperServer.java| 2 ++ pom.xml | 3 +- 7 files changed, 61 insertions(+), 9 deletions(-) -- http://git-wip-us.apache.org/repos/asf/curator/blob/0603e958/curator-framework/src/test/java/org/apache/curator/framework/imps/TestFramework.java -- diff --git a/curator-framework/src/test/java/org/apache/curator/framework/imps/TestFramework.java b/curator-framework/src/test/java/org/apache/curator/framework/imps/TestFramework.java index 811631c..472e0fc 100644 --- a/curator-framework/src/test/java/org/apache/curator/framework/imps/TestFramework.java +++ b/curator-framework/src/test/java/org/apache/curator/framework/imps/TestFramework.java @@ -59,7 +59,7 @@ public class TestFramework extends BaseClassForTests @Override public void setup() throws Exception { -System.setProperty("container.checkIntervalMs", "1000"); +System.setProperty("znode.container.checkIntervalMs", "1000"); super.setup(); } @@ -67,7 +67,7 @@ public class TestFramework extends BaseClassForTests @Override public void teardown() throws Exception { -System.clearProperty("container.checkIntervalMs"); +System.clearProperty("znode.container.checkIntervalMs"); super.teardown(); } http://git-wip-us.apache.org/repos/asf/curator/blob/0603e958/curator-framework/src/test/java/org/apache/curator/framework/imps/TestReconfiguration.java -- diff --git a/curator-framework/src/test/java/org/apache/curator/framework/imps/TestReconfiguration.java b/curator-framework/src/test/java/org/apache/curator/framework/imps/TestReconfiguration.java index 2438ef8..a99617b 100644 --- a/curator-framework/src/test/java/org/apache/curator/framework/imps/TestReconfiguration.java +++ b/curator-framework/src/test/java/org/apache/curator/framework/imps/TestReconfiguration.java @@ -27,6 +27,7 @@ import org.apache.curator.framework.api.BackgroundCallback; import org.apache.curator.framework.api.CuratorEvent; import org.apache.curator.framework.ensemble.EnsembleTracker; import org.apache.curator.retry.RetryOneTime; +import org.apache.curator.test.BaseClassForTests; import org.apache.curator.test.InstanceSpec; import org.apache.curator.test.TestingCluster; import org.apache.curator.test.Timing; @@ -47,7 +48,7 @@ import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeoutException; import java.util.concurrent.atomic.AtomicReference; -public class TestReconfiguration +public class TestReconfiguration extends BaseClassForTests { private static final Timing timing = new Timing(); private TestingCluster cluster; http://git-wip-us.apache.org/repos/asf/curator/blob/0603e958/curator-recipes/src/test/java/org/apache/curator/framework/recipes/locks/TestInterProcessMutexBase.java -- diff --git a/curator-recipes/src/test/java/org/apache/curator/framework/recipes/locks/TestInterProcessMutexBase.java b/curator-recipes/src/test/java/org/apache/curator/framework/recipes/locks/TestInterProcessMutexBase.java index 5a8168e..0cf8d45 100644 --- a/curator-recipes/src/test/java/org/apache/curator/framework/recipes/locks/TestInterProcessMutexBase.java +++ b/curator-recipes/src/test/java/org/apache/curator/framework/recipes/locks/TestInterProcessMutexBase.java @@ -211,7 +211,7 @@ public abstract class TestInterProcessMutexBase extends BaseClassForTests server.close(); -System.setProperty("container.checkIntervalMs", "10"); +System.setProperty("znode.container.checkIntervalMs", "10"); try { server = new TestingServer(); @@ -272,7 +272,7 @@ public abstract class TestInterProcessMutexBase extends BaseClassForTests } finally { -
[2/8] curator git commit: moved to ZK 3.5.1.
moved to ZK 3.5.1. Project: http://git-wip-us.apache.org/repos/asf/curator/repo Commit: http://git-wip-us.apache.org/repos/asf/curator/commit/fad27086 Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/fad27086 Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/fad27086 Branch: refs/heads/CURATOR-3.0 Commit: fad270861feb4dbda36fdea76b4db9ec29e92001 Parents: 911f02b Author: randgaltAuthored: Thu Sep 10 09:22:11 2015 -0500 Committer: randgalt Committed: Thu Sep 10 09:22:11 2015 -0500 -- .../recipes/leader/ChaosMonkeyCnxnFactory.java | 2 -- .../curator/test/TestingZooKeeperMain.java | 36 +++- pom.xml | 11 +- 3 files changed, 29 insertions(+), 20 deletions(-) -- http://git-wip-us.apache.org/repos/asf/curator/blob/fad27086/curator-recipes/src/test/java/org/apache/curator/framework/recipes/leader/ChaosMonkeyCnxnFactory.java -- diff --git a/curator-recipes/src/test/java/org/apache/curator/framework/recipes/leader/ChaosMonkeyCnxnFactory.java b/curator-recipes/src/test/java/org/apache/curator/framework/recipes/leader/ChaosMonkeyCnxnFactory.java index 3aeec81..4cb342c 100644 --- a/curator-recipes/src/test/java/org/apache/curator/framework/recipes/leader/ChaosMonkeyCnxnFactory.java +++ b/curator-recipes/src/test/java/org/apache/curator/framework/recipes/leader/ChaosMonkeyCnxnFactory.java @@ -31,8 +31,6 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.io.IOException; import java.nio.ByteBuffer; -import java.nio.channels.SelectionKey; -import java.nio.channels.SocketChannel; /** * A connection factory that will behave like the NIOServerCnxnFactory except that http://git-wip-us.apache.org/repos/asf/curator/blob/fad27086/curator-test/src/main/java/org/apache/curator/test/TestingZooKeeperMain.java -- diff --git a/curator-test/src/main/java/org/apache/curator/test/TestingZooKeeperMain.java b/curator-test/src/main/java/org/apache/curator/test/TestingZooKeeperMain.java index 702824a..a4cca8e 100644 --- a/curator-test/src/main/java/org/apache/curator/test/TestingZooKeeperMain.java +++ b/curator-test/src/main/java/org/apache/curator/test/TestingZooKeeperMain.java @@ -30,12 +30,14 @@ import org.apache.zookeeper.server.quorum.QuorumPeer; import org.apache.zookeeper.server.quorum.QuorumPeerConfig; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import org.testng.Assert; import javax.management.JMException; import java.io.IOException; import java.lang.reflect.Field; import java.lang.reflect.Modifier; import java.nio.channels.ServerSocketChannel; import java.util.concurrent.CountDownLatch; +import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicReference; public class TestingZooKeeperMain implements ZooKeeperMainFace @@ -48,7 +50,9 @@ public class TestingZooKeeperMain implements ZooKeeperMainFace private volatile ServerCnxnFactory cnxnFactory; private volatile ZooKeeperServer zkServer; -static final int MAX_WAIT_MS = new Timing().milliseconds(); +private static final Timing timing = new Timing(); + +static final int MAX_WAIT_MS = timing.milliseconds(); @Override public void kill() @@ -124,7 +128,7 @@ public class TestingZooKeeperMain implements ZooKeeperMainFace @Override public void blockUntilStarted() throws Exception { -latch.await(); +Assert.assertTrue(timing.awaitLatch(latch)); if ( zkServer != null ) { @@ -139,7 +143,7 @@ public class TestingZooKeeperMain implements ZooKeeperMainFace } else { -throw new Exception("No zkServer. zkServer is volatile: " + Modifier.isVolatile(cnxnFactory.getClass().getDeclaredField("zkServer").getModifiers())); +throw new Exception("No zkServer."); } Exception exception = startingException.get(); @@ -201,9 +205,17 @@ public class TestingZooKeeperMain implements ZooKeeperMainFace txnLog = new FileTxnSnapLog(config.getDataLogDir(), config.getDataDir()); zkServer = new TestZooKeeperServer(txnLog, config); -cnxnFactory = ServerCnxnFactory.createFactory(); -cnxnFactory.configure(config.getClientPortAddress(), -config.getMaxClientCnxns()); +try +{ +cnxnFactory = ServerCnxnFactory.createFactory(); +cnxnFactory.configure(config.getClientPortAddress(), +config.getMaxClientCnxns()); +} +catch ( IOException e ) +{ +log.info("Could not server. Waiting and
[4/8] curator git commit: oops - forgot to try again on bind exception
oops - forgot to try again on bind exception Project: http://git-wip-us.apache.org/repos/asf/curator/repo Commit: http://git-wip-us.apache.org/repos/asf/curator/commit/f8f13c25 Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/f8f13c25 Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/f8f13c25 Branch: refs/heads/CURATOR-3.0 Commit: f8f13c25d65e96efa6a0718515e8e035d72de7e9 Parents: 0603e95 Author: randgaltAuthored: Thu Sep 10 21:20:14 2015 -0500 Committer: randgalt Committed: Thu Sep 10 21:20:14 2015 -0500 -- .../main/java/org/apache/curator/test/TestingZooKeeperMain.java | 3 +++ 1 file changed, 3 insertions(+) -- http://git-wip-us.apache.org/repos/asf/curator/blob/f8f13c25/curator-test/src/main/java/org/apache/curator/test/TestingZooKeeperMain.java -- diff --git a/curator-test/src/main/java/org/apache/curator/test/TestingZooKeeperMain.java b/curator-test/src/main/java/org/apache/curator/test/TestingZooKeeperMain.java index 82bcd9b..795e5d0 100644 --- a/curator-test/src/main/java/org/apache/curator/test/TestingZooKeeperMain.java +++ b/curator-test/src/main/java/org/apache/curator/test/TestingZooKeeperMain.java @@ -224,6 +224,9 @@ public class TestingZooKeeperMain implements ZooKeeperMainFace { log.info("Could not server. Waiting and trying one more time.", e); timing.sleepABit(); +cnxnFactory = ServerCnxnFactory.createFactory(); +cnxnFactory.configure(config.getClientPortAddress(), +config.getMaxClientCnxns()); } cnxnFactory.startup(zkServer); containerManager = new ContainerManager(zkServer.getZKDatabase(), zkServer.getFirstProcessor(), Integer.getInteger("znode.container.checkIntervalMs", (int)TimeUnit.MINUTES.toMillis(1L)).intValue(), Integer.getInteger("znode.container.maxPerMinute", 1).intValue());
[1/8] curator git commit: Removed usages of Javaassist and simplified how the in-memory ZK server is created and run. Tests should be more reliable and the testing server should respond faster
Repository: curator Updated Branches: refs/heads/CURATOR-3.0 ea36769af -> afa8f7a45 Removed usages of Javaassist and simplified how the in-memory ZK server is created and run. Tests should be more reliable and the testing server should respond faster Project: http://git-wip-us.apache.org/repos/asf/curator/repo Commit: http://git-wip-us.apache.org/repos/asf/curator/commit/911f02b1 Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/911f02b1 Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/911f02b1 Branch: refs/heads/CURATOR-3.0 Commit: 911f02b15e9585e893bdd2c9bdd860fbf85bba4c Parents: 73b05aa Author: randgaltAuthored: Wed Sep 9 20:13:56 2015 -0500 Committer: randgalt Committed: Wed Sep 9 20:13:56 2015 -0500 -- .../recipes/leader/ChaosMonkeyCnxnFactory.java | 22 ++- curator-test/pom.xml| 5 - .../apache/curator/test/BaseClassForTests.java | 1 + .../apache/curator/test/ByteCodeRewrite.java| 131 .../org/apache/curator/test/TestingCluster.java | 5 - .../org/apache/curator/test/TestingServer.java | 5 - .../curator/test/TestingZooKeeperMain.java | 197 +++ pom.xml | 7 - 8 files changed, 134 insertions(+), 239 deletions(-) -- http://git-wip-us.apache.org/repos/asf/curator/blob/911f02b1/curator-recipes/src/test/java/org/apache/curator/framework/recipes/leader/ChaosMonkeyCnxnFactory.java -- diff --git a/curator-recipes/src/test/java/org/apache/curator/framework/recipes/leader/ChaosMonkeyCnxnFactory.java b/curator-recipes/src/test/java/org/apache/curator/framework/recipes/leader/ChaosMonkeyCnxnFactory.java index 1c0e50e..3aeec81 100644 --- a/curator-recipes/src/test/java/org/apache/curator/framework/recipes/leader/ChaosMonkeyCnxnFactory.java +++ b/curator-recipes/src/test/java/org/apache/curator/framework/recipes/leader/ChaosMonkeyCnxnFactory.java @@ -19,6 +19,7 @@ package org.apache.curator.framework.recipes.leader; +import org.apache.curator.test.TestingZooKeeperMain; import org.apache.zookeeper.ZooDefs; import org.apache.zookeeper.proto.CreateRequest; import org.apache.zookeeper.server.ByteBufferInputStream; @@ -49,23 +50,20 @@ public class ChaosMonkeyCnxnFactory extends NIOServerCnxnFactory /* How long after the first error, connections are rejected */ public static final long LOCKOUT_DURATION_MS = 6000; -public ChaosMonkeyCnxnFactory() throws IOException -{ -} - @Override public void startup(ZooKeeperServer zks) throws IOException, InterruptedException { super.startup(new ChaosMonkeyZookeeperServer(zks)); } - public static class ChaosMonkeyZookeeperServer extends ZooKeeperServer { +private final ZooKeeperServer zks; private long firstError = 0; public ChaosMonkeyZookeeperServer(ZooKeeperServer zks) { +this.zks = zks; setTxnLogFactory(zks.getTxnLogFactory()); setTickTime(zks.getTickTime()); setMinSessionTimeout(zks.getMinSessionTimeout()); @@ -73,6 +71,20 @@ public class ChaosMonkeyCnxnFactory extends NIOServerCnxnFactory } @Override +public void startup() +{ +super.startup(); +if ( zks instanceof TestingZooKeeperMain.TestZooKeeperServer ) +{ +((TestingZooKeeperMain.TestZooKeeperServer)zks).noteStartup(); +} +else +{ +throw new RuntimeException("Unknown ZooKeeperServer: " + zks.getClass()); +} +} + +@Override public void submitRequest(Request si) { long remaining = firstError != 0 ? LOCKOUT_DURATION_MS - (System.currentTimeMillis() - firstError) : 0; http://git-wip-us.apache.org/repos/asf/curator/blob/911f02b1/curator-test/pom.xml -- diff --git a/curator-test/pom.xml b/curator-test/pom.xml index 80eedb2..d401da5 100644 --- a/curator-test/pom.xml +++ b/curator-test/pom.xml @@ -41,11 +41,6 @@ -org.javassist -javassist - - - org.apache.commons commons-math http://git-wip-us.apache.org/repos/asf/curator/blob/911f02b1/curator-test/src/main/java/org/apache/curator/test/BaseClassForTests.java -- diff --git a/curator-test/src/main/java/org/apache/curator/test/BaseClassForTests.java b/curator-test/src/main/java/org/apache/curator/test/BaseClassForTests.java index 1f6503d..a3bc2b5 100644 ---
[5/8] curator git commit: test assumed first latch would be leader. Fixed it so that this is so
test assumed first latch would be leader. Fixed it so that this is so Project: http://git-wip-us.apache.org/repos/asf/curator/repo Commit: http://git-wip-us.apache.org/repos/asf/curator/commit/a9271ff6 Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/a9271ff6 Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/a9271ff6 Branch: refs/heads/CURATOR-3.0 Commit: a9271ff6033557efeda01e4c543d0f840519e64d Parents: f8f13c2 Author: randgaltAuthored: Thu Sep 10 22:37:57 2015 -0500 Committer: randgalt Committed: Thu Sep 10 22:37:57 2015 -0500 -- .../apache/curator/framework/recipes/leader/TestLeaderLatch.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/curator/blob/a9271ff6/curator-recipes/src/test/java/org/apache/curator/framework/recipes/leader/TestLeaderLatch.java -- diff --git a/curator-recipes/src/test/java/org/apache/curator/framework/recipes/leader/TestLeaderLatch.java b/curator-recipes/src/test/java/org/apache/curator/framework/recipes/leader/TestLeaderLatch.java index ecaa433..991e6fc 100644 --- a/curator-recipes/src/test/java/org/apache/curator/framework/recipes/leader/TestLeaderLatch.java +++ b/curator-recipes/src/test/java/org/apache/curator/framework/recipes/leader/TestLeaderLatch.java @@ -403,10 +403,9 @@ public class TestLeaderLatch extends BaseClassForTests LeaderLatch latch = new LeaderLatch(client, PATH_NAME); latch.start(); latches.add(latch); +waitForALeader(latches, timing); } -waitForALeader(latches, timing); - //we need to close a Participant that doesn't be actual leader (first Participant) nor the last latches.get(PARTICIPANT_ID).close();
[1/4] curator git commit: interim work - updated APIs make sure old tests work
Repository: curator Updated Branches: refs/heads/CURATOR-265 [created] 36ddd58a3 interim work - updated APIs make sure old tests work Project: http://git-wip-us.apache.org/repos/asf/curator/repo Commit: http://git-wip-us.apache.org/repos/asf/curator/commit/2c0fca86 Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/2c0fca86 Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/2c0fca86 Branch: refs/heads/CURATOR-265 Commit: 2c0fca86ca3c25c9777e1b5c3bb3eea6cb0be8da Parents: ea36769 Author: randgaltAuthored: Fri Sep 25 19:14:53 2015 -0500 Committer: randgalt Committed: Fri Sep 25 19:14:53 2015 -0500 -- .../api/AddStatConfigEnsembleable.java | 5 +- .../framework/api/BackgroundEnsembleable.java | 7 + .../framework/api/BackgroundStatable.java | 24 - .../curator/framework/api/Configurable.java | 31 -- .../framework/api/ConfigureEnsembleable.java| 32 ++ .../curator/framework/api/GetConfigBuilder.java | 9 +- .../api/JoinAddStatConfigEnsembleable.java | 3 +- .../api/JoinLeaveStatConfigEnsembleable.java| 3 +- .../api/JoinStatConfigEnsembleable.java | 5 +- .../framework/api/JoinStatConfigurable.java | 2 +- .../api/LeaveAddStatConfigEnsembleable.java | 3 +- .../api/LeaveStatConfigEnsembleable.java| 5 +- .../curator/framework/api/ReconfigBuilder.java | 4 +- .../framework/api/StatConfigEnsembleable.java | 26 - .../curator/framework/api/StatEnsembleable.java | 26 - .../api/WatchBackgroundEnsembleable.java| 7 + .../framework/imps/GetConfigBuilderImpl.java| 125 - .../framework/imps/ReconfigBuilderImpl.java | 110 +++-- .../framework/imps/TestReconfiguration.java | 474 +-- .../framework/imps/TestReconfigurationX.java| 418 20 files changed, 798 insertions(+), 521 deletions(-) -- http://git-wip-us.apache.org/repos/asf/curator/blob/2c0fca86/curator-framework/src/main/java/org/apache/curator/framework/api/AddStatConfigEnsembleable.java -- diff --git a/curator-framework/src/main/java/org/apache/curator/framework/api/AddStatConfigEnsembleable.java b/curator-framework/src/main/java/org/apache/curator/framework/api/AddStatConfigEnsembleable.java index 16f78a2..c60f617 100644 --- a/curator-framework/src/main/java/org/apache/curator/framework/api/AddStatConfigEnsembleable.java +++ b/curator-framework/src/main/java/org/apache/curator/framework/api/AddStatConfigEnsembleable.java @@ -25,8 +25,9 @@ package org.apache.curator.framework.api; * mixing concepts that can't be used together. */ public interface AddStatConfigEnsembleable extends -Addable, -StatConfigEnsembleable +Addable , +ConfigureEnsembleable, +Statable { } http://git-wip-us.apache.org/repos/asf/curator/blob/2c0fca86/curator-framework/src/main/java/org/apache/curator/framework/api/BackgroundEnsembleable.java -- diff --git a/curator-framework/src/main/java/org/apache/curator/framework/api/BackgroundEnsembleable.java b/curator-framework/src/main/java/org/apache/curator/framework/api/BackgroundEnsembleable.java new file mode 100644 index 000..ae2b226 --- /dev/null +++ b/curator-framework/src/main/java/org/apache/curator/framework/api/BackgroundEnsembleable.java @@ -0,0 +1,7 @@ +package org.apache.curator.framework.api; + +public interface BackgroundEnsembleable extends +Backgroundable , +Ensembleable +{ +} http://git-wip-us.apache.org/repos/asf/curator/blob/2c0fca86/curator-framework/src/main/java/org/apache/curator/framework/api/BackgroundStatable.java -- diff --git a/curator-framework/src/main/java/org/apache/curator/framework/api/BackgroundStatable.java b/curator-framework/src/main/java/org/apache/curator/framework/api/BackgroundStatable.java deleted file mode 100644 index 77c4e96..000 --- a/curator-framework/src/main/java/org/apache/curator/framework/api/BackgroundStatable.java +++ /dev/null @@ -1,24 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS"
[4/4] curator git commit: finalized the changes and removed old classes
finalized the changes and removed old classes Project: http://git-wip-us.apache.org/repos/asf/curator/repo Commit: http://git-wip-us.apache.org/repos/asf/curator/commit/36ddd58a Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/36ddd58a Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/36ddd58a Branch: refs/heads/CURATOR-265 Commit: 36ddd58a31045addfd9d984353956f7a99c09221 Parents: d42ef17 Author: randgaltAuthored: Fri Sep 25 21:49:12 2015 -0500 Committer: randgalt Committed: Fri Sep 25 21:49:12 2015 -0500 -- .../framework/api/ACLBackgroundPathable.java| 25 -- .../api/ACLVersionBackgroundPathable.java | 25 -- .../api/BackgroundPathableQuietly.java | 23 - .../api/CreateModalPathAndBytesable.java| 25 -- .../api/IncrementalReconfigBuilder.java | 33 -- .../api/JoinAddStatConfigEnsembleable.java | 34 -- .../api/JoinLeaveStatConfigEnsembleable.java| 34 -- .../framework/api/JoinStatConfigurable.java | 30 -- .../api/LeaveAddStatConfigEnsembleable.java | 33 -- .../framework/api/SyncReconfigurable.java | 30 -- .../framework/imps/TestReconfiguration.java | 58 ++- .../framework/imps/TestReconfigurationX.java| 425 --- .../org/apache/curator/test/TestingCluster.java | 16 +- 13 files changed, 49 insertions(+), 742 deletions(-) -- http://git-wip-us.apache.org/repos/asf/curator/blob/36ddd58a/curator-framework/src/main/java/org/apache/curator/framework/api/ACLBackgroundPathable.java -- diff --git a/curator-framework/src/main/java/org/apache/curator/framework/api/ACLBackgroundPathable.java b/curator-framework/src/main/java/org/apache/curator/framework/api/ACLBackgroundPathable.java deleted file mode 100644 index d63281d..000 --- a/curator-framework/src/main/java/org/apache/curator/framework/api/ACLBackgroundPathable.java +++ /dev/null @@ -1,25 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.curator.framework.api; - -public interface ACLBackgroundPathable extends -ACLable , -BackgroundPathable -{ -} http://git-wip-us.apache.org/repos/asf/curator/blob/36ddd58a/curator-framework/src/main/java/org/apache/curator/framework/api/ACLVersionBackgroundPathable.java -- diff --git a/curator-framework/src/main/java/org/apache/curator/framework/api/ACLVersionBackgroundPathable.java b/curator-framework/src/main/java/org/apache/curator/framework/api/ACLVersionBackgroundPathable.java deleted file mode 100644 index bc8e6bf..000 --- a/curator-framework/src/main/java/org/apache/curator/framework/api/ACLVersionBackgroundPathable.java +++ /dev/null @@ -1,25 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.curator.framework.api; - -public interface ACLVersionBackgroundPathable extends -ACLable >, -Versionable -{ -} http://git-wip-us.apache.org/repos/asf/curator/blob/36ddd58a/curator-framework/src/main/java/org/apache/curator/framework/api/BackgroundPathableQuietly.java
[2/4] curator git commit: Merge branch 'CURATOR-3.0' into CURATOR-265
Merge branch 'CURATOR-3.0' into CURATOR-265 Conflicts: curator-framework/src/test/java/org/apache/curator/framework/imps/TestReconfiguration.java Project: http://git-wip-us.apache.org/repos/asf/curator/repo Commit: http://git-wip-us.apache.org/repos/asf/curator/commit/4c3c8377 Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/4c3c8377 Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/4c3c8377 Branch: refs/heads/CURATOR-265 Commit: 4c3c8377935f8ae2c0f24c4a1010cf4bdef4e297 Parents: 2c0fca8 afa8f7a Author: randgaltAuthored: Fri Sep 25 19:22:10 2015 -0500 Committer: randgalt Committed: Fri Sep 25 19:22:10 2015 -0500 -- .../curator/framework/imps/TestFramework.java | 4 +- .../recipes/leader/ChaosMonkeyCnxnFactory.java | 24 +- .../recipes/leader/TestLeaderLatch.java | 3 +- .../locks/TestInterProcessMutexBase.java| 6 +- curator-test/pom.xml| 5 - .../apache/curator/test/BaseClassForTests.java | 1 + .../apache/curator/test/ByteCodeRewrite.java| 131 -- .../curator/test/QuorumConfigBuilder.java | 36 ++- .../org/apache/curator/test/TestingCluster.java | 5 - .../org/apache/curator/test/TestingServer.java | 5 - .../curator/test/TestingZooKeeperMain.java | 236 --- .../curator/test/TestingZooKeeperServer.java| 2 + pom.xml | 21 +- 13 files changed, 218 insertions(+), 261 deletions(-) --
curator git commit: Fixed newMembers test
Repository: curator Updated Branches: refs/heads/CURATOR-265 e09388a5a -> a8ec17ece Fixed newMembers test Project: http://git-wip-us.apache.org/repos/asf/curator/repo Commit: http://git-wip-us.apache.org/repos/asf/curator/commit/a8ec17ec Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/a8ec17ec Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/a8ec17ec Branch: refs/heads/CURATOR-265 Commit: a8ec17ece060484e0e6ce723568ed9505f6b82ef Parents: e09388a Author: randgaltAuthored: Fri Sep 25 22:05:43 2015 -0500 Committer: randgalt Committed: Fri Sep 25 22:05:43 2015 -0500 -- .../org/apache/curator/framework/imps/TestReconfiguration.java| 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/curator/blob/a8ec17ec/curator-framework/src/test/java/org/apache/curator/framework/imps/TestReconfiguration.java -- diff --git a/curator-framework/src/test/java/org/apache/curator/framework/imps/TestReconfiguration.java b/curator-framework/src/test/java/org/apache/curator/framework/imps/TestReconfiguration.java index ca00cba..e7d2229 100644 --- a/curator-framework/src/test/java/org/apache/curator/framework/imps/TestReconfiguration.java +++ b/curator-framework/src/test/java/org/apache/curator/framework/imps/TestReconfiguration.java @@ -282,7 +282,7 @@ public class TestReconfiguration extends BaseClassForTests client.start(); QuorumVerifier oldConfig = toQuorumVerifier(client.getConfig().forEnsemble()); -Assert.assertEquals(cluster.getInstances().size(), 5); +Assert.assertEquals(oldConfig.getAllMembers().size(), 5); assertConfig(oldConfig, cluster.getInstances()); CountDownLatch latch = setChangeWaiter(client); @@ -291,6 +291,7 @@ public class TestReconfiguration extends BaseClassForTests Assert.assertTrue(timing.awaitLatch(latch)); QuorumVerifier newConfig = toQuorumVerifier(client.getConfig().forEnsemble()); +Assert.assertEquals(newConfig.getAllMembers().size(), 3); assertConfig(newConfig, smallCluster); } }