HADOOP-2059 In tests, exceptions in min dfs shutdown should not fail test

(e.g. nightly #272)


git-svn-id: https://svn.apache.org/repos/asf/lucene/hadoop/trunk/src/contrib/hbase@584919 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Michael Stack 2007-10-15 21:05:23 +00:00
parent f07a9fd89a
commit 8a381624d9
4 changed files with 27 additions and 11 deletions

View File

@ -9,6 +9,8 @@ Trunk (unreleased changes)
OPTIMIZATIONS OPTIMIZATIONS
BUG FIXES BUG FIXES
HADOOP-2059 In tests, exceptions in min dfs shutdown should not fail test
(e.g. nightly #272)
IMPROVEMENTS IMPROVEMENTS
HADOOP-2401 Add convenience put method that takes writable HADOOP-2401 Add convenience put method that takes writable

View File

@ -79,18 +79,24 @@ public abstract class HBaseClusterTestCase extends HBaseTestCase {
@Override @Override
protected void setUp() throws Exception { protected void setUp() throws Exception {
super.setUp();
this.cluster = this.cluster =
new MiniHBaseCluster(this.conf, this.regionServers, this.miniHdfs); new MiniHBaseCluster(this.conf, this.regionServers, this.miniHdfs);
super.setUp();
} }
@Override @Override
protected void tearDown() throws Exception { protected void tearDown() throws Exception {
super.tearDown(); super.tearDown();
if (this.cluster != null) {
this.cluster.shutdown();
}
HConnectionManager.deleteConnection(conf); HConnectionManager.deleteConnection(conf);
if (this.cluster != null) {
try {
this.cluster.shutdown();
} catch (Exception e) {
LOG.warn("Closing mini dfs", e);
}
}
// ReflectionUtils.printThreadInfo(new PrintWriter(System.out),
// "Temporary end-of-test thread dump debugging HADOOP-2040: " + getName());
} }
@ -129,4 +135,4 @@ public abstract class HBaseClusterTestCase extends HBaseTestCase {
} }
} }
} }
} }

View File

@ -20,6 +20,7 @@
package org.apache.hadoop.hbase; package org.apache.hadoop.hbase;
import java.io.IOException; import java.io.IOException;
import java.io.PrintWriter;
import org.apache.commons.logging.Log; import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory; import org.apache.commons.logging.LogFactory;
@ -31,6 +32,7 @@ import org.apache.hadoop.io.MapFile;
import org.apache.hadoop.io.SequenceFile; import org.apache.hadoop.io.SequenceFile;
import org.apache.hadoop.io.Text; import org.apache.hadoop.io.Text;
import org.apache.hadoop.io.WritableComparable; import org.apache.hadoop.io.WritableComparable;
import org.apache.hadoop.util.ReflectionUtils;
/** /**
* Test HStoreFile * Test HStoreFile
@ -45,19 +47,25 @@ public class TestHStoreFile extends HBaseTestCase {
/** {@inheritDoc} */ /** {@inheritDoc} */
@Override @Override
public void setUp() throws Exception { public void setUp() throws Exception {
super.setUp();
this.cluster = new MiniDFSCluster(this.conf, 2, true, (String[])null); this.cluster = new MiniDFSCluster(this.conf, 2, true, (String[])null);
this.fs = cluster.getFileSystem(); this.fs = cluster.getFileSystem();
this.dir = new Path(DIR, getName()); this.dir = new Path(DIR, getName());
super.setUp();
} }
/** {@inheritDoc} */ /** {@inheritDoc} */
@Override @Override
public void tearDown() throws Exception { public void tearDown() throws Exception {
if (this.cluster != null) {
this.cluster.shutdown();
}
super.tearDown(); super.tearDown();
if (this.cluster != null) {
try {
this.cluster.shutdown();
} catch (Exception e) {
LOG.warn("Closing down mini DFS", e);
}
}
// ReflectionUtils.printThreadInfo(new PrintWriter(System.out),
// "Temporary end-of-test thread dump debugging HADOOP-2040: " + getName());
} }
private Path writeMapFile(final String name) private Path writeMapFile(final String name)
@ -382,4 +390,4 @@ public class TestHStoreFile extends HBaseTestCase {
this.fs.delete(p); this.fs.delete(p);
} }
} }
} }

View File

@ -67,7 +67,7 @@ public class TestRegionServerExit extends HBaseClusterTestCase {
* Test abort of region server. * Test abort of region server.
* @throws IOException * @throws IOException
*/ */
public void REMOVEtestCleanExit() throws IOException { public void testCleanExit() throws IOException {
// When the META table can be opened, the region servers are running // When the META table can be opened, the region servers are running
new HTable(this.conf, HConstants.META_TABLE_NAME); new HTable(this.conf, HConstants.META_TABLE_NAME);
// Create table and add a row. // Create table and add a row.