HBASE-10103. TestNodeHealthCheckChore#testRSHealthChore: Stoppable must have been stopped
git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1549930 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
155373eb93
commit
63aff6d35c
|
@ -43,6 +43,7 @@ public class TestNodeHealthCheckChore {
|
||||||
|
|
||||||
private static final Log LOG = LogFactory.getLog(TestNodeHealthCheckChore.class);
|
private static final Log LOG = LogFactory.getLog(TestNodeHealthCheckChore.class);
|
||||||
private static final HBaseTestingUtility UTIL = new HBaseTestingUtility();
|
private static final HBaseTestingUtility UTIL = new HBaseTestingUtility();
|
||||||
|
private static final int SCRIPT_TIMEOUT = 5000;
|
||||||
private File healthScriptFile;
|
private File healthScriptFile;
|
||||||
private String eol = System.getProperty("line.separator");
|
private String eol = System.getProperty("line.separator");
|
||||||
|
|
||||||
|
@ -69,7 +70,7 @@ public class TestNodeHealthCheckChore {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testHealthCheckerTimeout() throws Exception {
|
public void testHealthCheckerTimeout() throws Exception {
|
||||||
String timeOutScript = "sleep 4" + eol + "echo \"I am fine\"";
|
String timeOutScript = "sleep " + (SCRIPT_TIMEOUT * 2) + eol + "echo \"I am fine\"";
|
||||||
healthCheckerTest(timeOutScript, HealthCheckerExitStatus.TIMED_OUT);
|
healthCheckerTest(timeOutScript, HealthCheckerExitStatus.TIMED_OUT);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -78,7 +79,7 @@ public class TestNodeHealthCheckChore {
|
||||||
Configuration config = getConfForNodeHealthScript();
|
Configuration config = getConfForNodeHealthScript();
|
||||||
config.addResource(healthScriptFile.getName());
|
config.addResource(healthScriptFile.getName());
|
||||||
String location = healthScriptFile.getAbsolutePath();
|
String location = healthScriptFile.getAbsolutePath();
|
||||||
long timeout = config.getLong(HConstants.HEALTH_SCRIPT_TIMEOUT, 2000);
|
long timeout = config.getLong(HConstants.HEALTH_SCRIPT_TIMEOUT, SCRIPT_TIMEOUT);
|
||||||
|
|
||||||
HealthChecker checker = new HealthChecker();
|
HealthChecker checker = new HealthChecker();
|
||||||
checker.init(location, timeout);
|
checker.init(location, timeout);
|
||||||
|
@ -142,7 +143,7 @@ public class TestNodeHealthCheckChore {
|
||||||
healthScriptFile = new File(tempDir.getAbsolutePath(), scriptName);
|
healthScriptFile = new File(tempDir.getAbsolutePath(), scriptName);
|
||||||
conf.set(HConstants.HEALTH_SCRIPT_LOC, healthScriptFile.getAbsolutePath());
|
conf.set(HConstants.HEALTH_SCRIPT_LOC, healthScriptFile.getAbsolutePath());
|
||||||
conf.setLong(HConstants.HEALTH_FAILURE_THRESHOLD, 3);
|
conf.setLong(HConstants.HEALTH_FAILURE_THRESHOLD, 3);
|
||||||
conf.setLong(HConstants.HEALTH_SCRIPT_TIMEOUT, 2000);
|
conf.setLong(HConstants.HEALTH_SCRIPT_TIMEOUT, SCRIPT_TIMEOUT);
|
||||||
return conf;
|
return conf;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue