Return-Path: X-Original-To: apmail-hbase-commits-archive@www.apache.org Delivered-To: apmail-hbase-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 2FF2811B71 for ; Wed, 16 Jul 2014 06:15:34 +0000 (UTC) Received: (qmail 44953 invoked by uid 500); 16 Jul 2014 06:15:34 -0000 Delivered-To: apmail-hbase-commits-archive@hbase.apache.org Received: (qmail 44911 invoked by uid 500); 16 Jul 2014 06:15:33 -0000 Mailing-List: contact commits-help@hbase.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@hbase.apache.org Delivered-To: mailing list commits@hbase.apache.org Received: (qmail 44902 invoked by uid 99); 16 Jul 2014 06:15:33 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 16 Jul 2014 06:15:33 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 9655B98E50C; Wed, 16 Jul 2014 06:15:33 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: stack@apache.org To: commits@hbase.apache.org Date: Wed, 16 Jul 2014 06:15:33 -0000 Message-Id: X-Mailer: ASF-Git Admin Mailer Subject: [1/2] git commit: HBASE-11517 TestReplicaWithCluster turns zombie -- ADDS TIMEOUTS SO CAN DEBUG ZOMBIE Repository: hbase Updated Branches: refs/heads/branch-1 07643580b -> 14b331cca HBASE-11517 TestReplicaWithCluster turns zombie -- ADDS TIMEOUTS SO CAN DEBUG ZOMBIE Project: http://git-wip-us.apache.org/repos/asf/hbase/repo Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/7175f51f Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/7175f51f Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/7175f51f Branch: refs/heads/branch-1 Commit: 7175f51f0817e93fe2c46aa39937fdff73e383d6 Parents: 0764358 Author: stack Authored: Tue Jul 15 10:01:32 2014 -0700 Committer: stack Committed: Tue Jul 15 23:14:35 2014 -0700 ---------------------------------------------------------------------- .../hbase/client/TestReplicaWithCluster.java | 62 ++++++++++++-------- 1 file changed, 38 insertions(+), 24 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hbase/blob/7175f51f/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestReplicaWithCluster.java ---------------------------------------------------------------------- diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestReplicaWithCluster.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestReplicaWithCluster.java index bf7a93b..2c1f52b 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestReplicaWithCluster.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestReplicaWithCluster.java @@ -129,7 +129,7 @@ public class TestReplicaWithCluster { HTU.shutdownMiniCluster(); } - @Test + @Test (timeout=30000) public void testCreateDeleteTable() throws IOException { // Create table then get the single region for our new table. HTableDescriptor hdt = HTU.createTableDescriptor("testCreateDeleteTable"); @@ -162,7 +162,7 @@ public class TestReplicaWithCluster { HTU.deleteTable(hdt.getTableName()); } - @Test + @Test (timeout=30000) public void testChangeTable() throws Exception { HTableDescriptor hdt = HTU.createTableDescriptor("testChangeTable"); hdt.setRegionReplication(NB_SERVERS); @@ -210,16 +210,20 @@ public class TestReplicaWithCluster { HTU.getHBaseCluster().stopMaster(0); HBaseAdmin admin = new HBaseAdmin(HTU.getConfiguration()); - nHdt =admin.getTableDescriptor(hdt.getTableName()); - Assert.assertEquals("fams=" + Arrays.toString(nHdt.getColumnFamilies()), + try { + nHdt = admin.getTableDescriptor(hdt.getTableName()); + Assert.assertEquals("fams=" + Arrays.toString(nHdt.getColumnFamilies()), bHdt.getColumnFamilies().length + 1, nHdt.getColumnFamilies().length); - admin.disableTable(hdt.getTableName()); - admin.deleteTable(hdt.getTableName()); - HTU.getHBaseCluster().startMaster(); + admin.disableTable(hdt.getTableName()); + admin.deleteTable(hdt.getTableName()); + HTU.getHBaseCluster().startMaster(); + } finally { + if (admin != null) admin.close(); + } } - @Test + @Test (timeout=30000) public void testReplicaAndReplication() throws Exception { HTableDescriptor hdt = HTU.createTableDescriptor("testReplicaAndReplication"); hdt.setRegionReplication(NB_SERVERS); @@ -242,19 +246,23 @@ public class TestReplicaWithCluster { HTU2.getHBaseAdmin().createTable(hdt, HBaseTestingUtility.KEYS_FOR_HBA_CREATE_TABLE); ReplicationAdmin admin = new ReplicationAdmin(HTU.getConfiguration()); - admin.addPeer("2", HTU2.getClusterKey()); + try { + admin.addPeer("2", HTU2.getClusterKey()); + } finally { + if (admin != null) admin.close(); + } Put p = new Put(row); p.add(row, row, row); final HTable table = new HTable(HTU.getConfiguration(), hdt.getTableName()); - table.put(p); - - HTU.getHBaseAdmin().flush(table.getTableName()); - LOG.info("Put & flush done on the first cluster. Now doing a get on the same cluster."); + try { + table.put(p); + HTU.getHBaseAdmin().flush(table.getTableName()); + LOG.info("Put & flush done on the first cluster. Now doing a get on the same cluster."); - Waiter.waitFor(HTU.getConfiguration(), 1000, new Waiter.Predicate() { - @Override - public boolean evaluate() throws Exception { + Waiter.waitFor(HTU.getConfiguration(), 1000, new Waiter.Predicate() { + @Override + public boolean evaluate() throws Exception { try { SlowMeCopro.cdl.set(new CountDownLatch(1)); Get g = new Get(row); @@ -265,15 +273,18 @@ public class TestReplicaWithCluster { } finally { SlowMeCopro.cdl.get().countDown(); SlowMeCopro.sleepTime.set(0); - } } - }); - + } + }}); + } finally { + if (table != null) table.close(); + } LOG.info("stale get on the first cluster done. Now for the second."); final HTable table2 = new HTable(HTU.getConfiguration(), hdt.getTableName()); - Waiter.waitFor(HTU.getConfiguration(), 1000, new Waiter.Predicate() { - @Override - public boolean evaluate() throws Exception { + try { + Waiter.waitFor(HTU.getConfiguration(), 1000, new Waiter.Predicate() { + @Override + public boolean evaluate() throws Exception { try { SlowMeCopro.cdl.set(new CountDownLatch(1)); Get g = new Get(row); @@ -284,8 +295,11 @@ public class TestReplicaWithCluster { } finally { SlowMeCopro.cdl.get().countDown(); SlowMeCopro.sleepTime.set(0); - } } - }); + } + }}); + } finally { + if (table2 != null) table2.close(); + } HTU.getHBaseAdmin().disableTable(hdt.getTableName()); HTU.deleteTable(hdt.getTableName());