HBASE-7430 TestSnapshotDescriptionUtils break compaction/scanner tests (EnvironmentEdge issue) (Matteo Bertozzi)

git-svn-id: https://svn.apache.org/repos/asf/hbase/branches/hbase-7290@1445799 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Jonathan Hsieh 2013-02-13 18:22:06 +00:00
parent 3ca47fab92
commit 03cf01614f
1 changed files with 9 additions and 8 deletions

View File

@ -29,7 +29,7 @@ import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.FileSystem;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.hbase.HBaseTestingUtility;
import org.apache.hadoop.hbase.SmallTests;
import org.apache.hadoop.hbase.MediumTests;
import org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.SnapshotDescription;
import org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.SnapshotDescription.Type;
import org.apache.hadoop.hbase.util.EnvironmentEdge;
@ -42,7 +42,7 @@ import org.junit.experimental.categories.Category;
/**
* Test that the {@link SnapshotDescription} helper is helping correctly.
*/
@Category(SmallTests.class)
@Category(MediumTests.class)
public class TestSnapshotDescriptionUtils {
private static final HBaseTestingUtility UTIL = new HBaseTestingUtility();
private static FileSystem fs;
@ -57,13 +57,14 @@ public class TestSnapshotDescriptionUtils {
@After
public void cleanupFS() throws Exception {
if (fs.exists(root)) {
if (!fs.delete(root, true)) {
throw new IOException("Failed to delete root test dir: " + root);
}
if (!fs.mkdirs(root)) {
throw new IOException("Failed to create root test dir: " + root);
}
if (!fs.delete(root, true)) {
throw new IOException("Failed to delete root test dir: " + root);
}
if (!fs.mkdirs(root)) {
throw new IOException("Failed to create root test dir: " + root);
}
}
EnvironmentEdgeManagerTestHelper.reset();
}
private static final Log LOG = LogFactory.getLog(TestSnapshotDescriptionUtils.class);