HBASE-12367 Integration tests should not restore the cluster if the CM is not destructive
This commit is contained in:
parent
a26bcdd4d9
commit
80f83db0b8
|
@ -178,6 +178,9 @@ public abstract class IntegrationTestBase extends AbstractHBaseTool {
|
|||
public abstract void setUpCluster() throws Exception;
|
||||
|
||||
public void cleanUpCluster() throws Exception {
|
||||
if (util.isDistributedCluster() && (monkey == null || !monkey.isDestructive())) {
|
||||
noClusterCleanUp = true;
|
||||
}
|
||||
if (noClusterCleanUp) {
|
||||
LOG.debug("noClusterCleanUp is set, skip restoring the cluster");
|
||||
return;
|
||||
|
|
|
@ -41,4 +41,9 @@ public class CalmChaosMonkey extends ChaosMonkey {
|
|||
public void waitForStop() throws InterruptedException {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isDestructive() {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -51,4 +51,10 @@ public abstract class ChaosMonkey implements Stoppable {
|
|||
public abstract boolean isStopped();
|
||||
|
||||
public abstract void waitForStop() throws InterruptedException;
|
||||
|
||||
/**
|
||||
* Returns whether the CM does destructive actions (killing servers) so that a cluster restore
|
||||
* is needed after CM is stopped. Otherwise cluster will be left as it is
|
||||
*/
|
||||
public abstract boolean isDestructive();
|
||||
}
|
||||
|
|
|
@ -149,4 +149,10 @@ public class PolicyBasedChaosMonkey extends ChaosMonkey {
|
|||
monkeyThread.join();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isDestructive() {
|
||||
// TODO: we can look at the actions, and decide to do the restore cluster or not based on them.
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue