Repository: accumulo Updated Branches: refs/heads/master 1dfe826ce -> bedf402d6
ACCUMULO-2480 move IT into the src/test tree Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/bedf402d Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/bedf402d Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/bedf402d Branch: refs/heads/master Commit: bedf402d654db11c0325686a9ae91eb1f363bc45 Parents: 1dfe826 Author: Eric C. Newton <[email protected]> Authored: Mon Sep 29 11:25:48 2014 -0400 Committer: Eric C. Newton <[email protected]> Committed: Mon Sep 29 11:25:48 2014 -0400 ---------------------------------------------------------------------- .../accumulo/test/TabletServerGivesUpIT.java | 73 -------------------- .../accumulo/test/TabletServerGivesUpIT.java | 72 +++++++++++++++++++ 2 files changed, 72 insertions(+), 73 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/accumulo/blob/bedf402d/test/src/main/java/org/apache/accumulo/test/TabletServerGivesUpIT.java ---------------------------------------------------------------------- diff --git a/test/src/main/java/org/apache/accumulo/test/TabletServerGivesUpIT.java b/test/src/main/java/org/apache/accumulo/test/TabletServerGivesUpIT.java deleted file mode 100644 index e2e5ac9..0000000 --- a/test/src/main/java/org/apache/accumulo/test/TabletServerGivesUpIT.java +++ /dev/null @@ -1,73 +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.accumulo.test; - -import java.util.TreeSet; -import java.util.concurrent.atomic.AtomicReference; - -import org.apache.accumulo.core.client.Connector; -import org.apache.accumulo.core.conf.Property; -import org.apache.accumulo.core.util.UtilWaitThread; -import org.apache.accumulo.minicluster.impl.MiniAccumuloConfigImpl; -import org.apache.accumulo.test.functional.ConfigurableMacIT; -import org.apache.hadoop.conf.Configuration; -import org.apache.hadoop.io.Text; -import org.junit.Test; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; - -// ACCUMULO-2480 -public class TabletServerGivesUpIT extends ConfigurableMacIT { - - @Override - public void configure(MiniAccumuloConfigImpl cfg, Configuration hadoopCoreSite) { - cfg.useMiniDFS(true); - cfg.setNumTservers(1); - cfg.setProperty(Property.INSTANCE_ZK_TIMEOUT, "5s"); - } - - @Test(timeout = 30 * 1000) - public void test() throws Exception { - final Connector conn = this.getConnector(); - // Yes, there's a tabletserver - assertEquals(1, conn.instanceOperations().getTabletServers().size()); - final String tableName = getUniqueNames(1)[0]; - conn.tableOperations().create(tableName); - // Kill dfs - cluster.getMiniDfs().shutdown(); - // ask the tserver to do something - final AtomicReference<Exception> ex = new AtomicReference<>(); - Thread splitter = new Thread() { - public void run() { - try { - TreeSet<Text> splits = new TreeSet<>(); - splits.add(new Text("X")); - conn.tableOperations().addSplits(tableName, splits); - } catch (Exception e) { - ex.set(e); - } - } - }; - splitter.start(); - // wait for the tserver to give up on writing to the WAL - while (conn.instanceOperations().getTabletServers().size() == 1) { - UtilWaitThread.sleep(1000); - } - } - -} http://git-wip-us.apache.org/repos/asf/accumulo/blob/bedf402d/test/src/test/java/org/apache/accumulo/test/TabletServerGivesUpIT.java ---------------------------------------------------------------------- diff --git a/test/src/test/java/org/apache/accumulo/test/TabletServerGivesUpIT.java b/test/src/test/java/org/apache/accumulo/test/TabletServerGivesUpIT.java new file mode 100644 index 0000000..0a62746 --- /dev/null +++ b/test/src/test/java/org/apache/accumulo/test/TabletServerGivesUpIT.java @@ -0,0 +1,72 @@ +/* + * 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.accumulo.test; + +import java.util.TreeSet; +import java.util.concurrent.atomic.AtomicReference; + +import org.apache.accumulo.core.client.Connector; +import org.apache.accumulo.core.conf.Property; +import org.apache.accumulo.core.util.UtilWaitThread; +import org.apache.accumulo.minicluster.impl.MiniAccumuloConfigImpl; +import org.apache.accumulo.test.functional.ConfigurableMacIT; +import org.apache.hadoop.conf.Configuration; +import org.apache.hadoop.io.Text; +import org.junit.Test; + +import static org.junit.Assert.assertEquals; + +// ACCUMULO-2480 +public class TabletServerGivesUpIT extends ConfigurableMacIT { + + @Override + public void configure(MiniAccumuloConfigImpl cfg, Configuration hadoopCoreSite) { + cfg.useMiniDFS(true); + cfg.setNumTservers(1); + cfg.setProperty(Property.INSTANCE_ZK_TIMEOUT, "5s"); + } + + @Test(timeout = 30 * 1000) + public void test() throws Exception { + final Connector conn = this.getConnector(); + // Yes, there's a tabletserver + assertEquals(1, conn.instanceOperations().getTabletServers().size()); + final String tableName = getUniqueNames(1)[0]; + conn.tableOperations().create(tableName); + // Kill dfs + cluster.getMiniDfs().shutdown(); + // ask the tserver to do something + final AtomicReference<Exception> ex = new AtomicReference<>(); + Thread splitter = new Thread() { + public void run() { + try { + TreeSet<Text> splits = new TreeSet<>(); + splits.add(new Text("X")); + conn.tableOperations().addSplits(tableName, splits); + } catch (Exception e) { + ex.set(e); + } + } + }; + splitter.start(); + // wait for the tserver to give up on writing to the WAL + while (conn.instanceOperations().getTabletServers().size() == 1) { + UtilWaitThread.sleep(1000); + } + } + +}
