From f83d17a70f3396e0d1e848687082939facae2513 Mon Sep 17 00:00:00 2001 From: Elliott Clark Date: Wed, 10 Jul 2013 20:29:00 -0700 Subject: [PATCH] Make sure that there is some sleep for chaos. --- .../java/org/apache/hadoop/hbase/mttr/IntegrationTestMTTR.java | 4 ++-- .../src/test/java/org/apache/hadoop/hbase/util/ChaosMonkey.java | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git hbase-it/src/test/java/org/apache/hadoop/hbase/mttr/IntegrationTestMTTR.java hbase-it/src/test/java/org/apache/hadoop/hbase/mttr/IntegrationTestMTTR.java index 3940835..2b4318d 100644 --- hbase-it/src/test/java/org/apache/hadoop/hbase/mttr/IntegrationTestMTTR.java +++ hbase-it/src/test/java/org/apache/hadoop/hbase/mttr/IntegrationTestMTTR.java @@ -172,8 +172,8 @@ public class IntegrationTestMTTR { // Set up the action that will move the regions of our table. moveRegionAction = new ChaosMonkey.MoveRegionsOfTable(SLEEP_TIME, tableName); - // Kill the master (No sleep time because there is only one master running at this time.) - restartMasterAction = new ChaosMonkey.RestartActiveMaster(0l); + // Kill the master + restartMasterAction = new ChaosMonkey.RestartActiveMaster(1000); // Give the action the access to the cluster. ChaosMonkey.ActionContext actionContext = new ChaosMonkey.ActionContext(util); diff --git hbase-it/src/test/java/org/apache/hadoop/hbase/util/ChaosMonkey.java hbase-it/src/test/java/org/apache/hadoop/hbase/util/ChaosMonkey.java index 48a291f..428329c 100644 --- hbase-it/src/test/java/org/apache/hadoop/hbase/util/ChaosMonkey.java +++ hbase-it/src/test/java/org/apache/hadoop/hbase/util/ChaosMonkey.java @@ -239,12 +239,14 @@ public class ChaosMonkey extends AbstractHBaseTool implements Stoppable { } void restartMaster(ServerName server, long sleepTime) throws IOException { + sleepTime = Math.max(sleepTime, 1000); killMaster(server); sleep(sleepTime); startMaster(server); } void restartRs(ServerName server, long sleepTime) throws IOException { + sleepTime = Math.max(sleepTime, 1000); killRs(server); sleep(sleepTime); startRs(server); -- 1.7.10.2 (Apple Git-33)