From 63aff6d35cd9c6ac7904c3ce328f88f0b2de2e70 Mon Sep 17 00:00:00 2001 From: Andrew Kyle Purtell Date: Tue, 10 Dec 2013 18:53:57 +0000 Subject: [PATCH] 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 --- .../org/apache/hadoop/hbase/TestNodeHealthCheckChore.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/TestNodeHealthCheckChore.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/TestNodeHealthCheckChore.java index 17036bec5d1..1e04175a5e3 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/TestNodeHealthCheckChore.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/TestNodeHealthCheckChore.java @@ -43,6 +43,7 @@ public class TestNodeHealthCheckChore { private static final Log LOG = LogFactory.getLog(TestNodeHealthCheckChore.class); private static final HBaseTestingUtility UTIL = new HBaseTestingUtility(); + private static final int SCRIPT_TIMEOUT = 5000; private File healthScriptFile; private String eol = System.getProperty("line.separator"); @@ -69,7 +70,7 @@ public class TestNodeHealthCheckChore { @Test 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); } @@ -78,7 +79,7 @@ public class TestNodeHealthCheckChore { Configuration config = getConfForNodeHealthScript(); config.addResource(healthScriptFile.getName()); 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(); checker.init(location, timeout); @@ -142,7 +143,7 @@ public class TestNodeHealthCheckChore { healthScriptFile = new File(tempDir.getAbsolutePath(), scriptName); conf.set(HConstants.HEALTH_SCRIPT_LOC, healthScriptFile.getAbsolutePath()); conf.setLong(HConstants.HEALTH_FAILURE_THRESHOLD, 3); - conf.setLong(HConstants.HEALTH_SCRIPT_TIMEOUT, 2000); + conf.setLong(HConstants.HEALTH_SCRIPT_TIMEOUT, SCRIPT_TIMEOUT); return conf; }