HBASE-15034 IntegrationTestDDLMasterFailover does not clean created namespaces.

Signed-off-by: Matteo Bertozzi <matteo.bertozzi@cloudera.com>
This commit is contained in:
Samir Ahmic 2015-12-23 23:30:26 +01:00 committed by Matteo Bertozzi
parent 4a7565af9c
commit b59f0240e5
1 changed files with 12 additions and 4 deletions

View File

@ -103,7 +103,7 @@ public class IntegrationTestDDLMasterFailover extends IntegrationTestBase {
protected static final int DEFAULT_NUM_REGIONS = 50; // number of regions in pre-split tables protected static final int DEFAULT_NUM_REGIONS = 50; // number of regions in pre-split tables
private boolean keepTableAtTheEnd = false; private boolean keepObjectsAtTheEnd = false;
protected HBaseCluster cluster; protected HBaseCluster cluster;
protected Connection connection; protected Connection connection;
@ -144,11 +144,19 @@ public class IntegrationTestDDLMasterFailover extends IntegrationTestBase {
@Override @Override
public void cleanUpCluster() throws Exception { public void cleanUpCluster() throws Exception {
if (!keepTableAtTheEnd) { if (!keepObjectsAtTheEnd) {
Admin admin = util.getHBaseAdmin(); Admin admin = util.getHBaseAdmin();
admin.disableTables("ittable-\\d+"); admin.disableTables("ittable-\\d+");
admin.deleteTables("ittable-\\d+"); admin.deleteTables("ittable-\\d+");
NamespaceDescriptor [] nsds = admin.listNamespaceDescriptors();
for(NamespaceDescriptor nsd:nsds ) {
if(nsd.getName().matches("itnamespace\\d+")) {
LOG.info("Removing namespace="+nsd.getName());
admin.deleteNamespace(nsd.getName());
}
}
} }
enabledTables.clear(); enabledTables.clear();
disabledTables.clear(); disabledTables.clear();
deletedTables.clear(); deletedTables.clear();
@ -938,9 +946,9 @@ public class IntegrationTestDDLMasterFailover extends IntegrationTestBase {
LOG.info("Running hbck"); LOG.info("Running hbck");
hbck = HbckTestingUtil.doFsck(util.getConfiguration(), false); hbck = HbckTestingUtil.doFsck(util.getConfiguration(), false);
if (HbckTestingUtil.inconsistencyFound(hbck)) { if (HbckTestingUtil.inconsistencyFound(hbck)) {
// Find the inconsistency during HBCK. Leave table undropped so that // Find the inconsistency during HBCK. Leave table and namespace undropped so that
// we can check outside the test. // we can check outside the test.
keepTableAtTheEnd = true; keepObjectsAtTheEnd = true;
} }
HbckTestingUtil.assertNoErrors(hbck); HbckTestingUtil.assertNoErrors(hbck);
LOG.info("Finished hbck"); LOG.info("Finished hbck");