Return-Path: X-Original-To: apmail-accumulo-commits-archive@www.apache.org Delivered-To: apmail-accumulo-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 03E1010FE4 for ; Tue, 11 Mar 2014 18:25:38 +0000 (UTC) Received: (qmail 77714 invoked by uid 500); 11 Mar 2014 18:25:33 -0000 Delivered-To: apmail-accumulo-commits-archive@accumulo.apache.org Received: (qmail 77579 invoked by uid 500); 11 Mar 2014 18:25:28 -0000 Mailing-List: contact commits-help@accumulo.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@accumulo.apache.org Delivered-To: mailing list commits@accumulo.apache.org Received: (qmail 77017 invoked by uid 99); 11 Mar 2014 18:25:11 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 11 Mar 2014 18:25:11 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id D7A0794061B; Tue, 11 Mar 2014 18:25:10 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: elserj@apache.org To: commits@accumulo.apache.org Date: Tue, 11 Mar 2014 18:25:20 -0000 Message-Id: In-Reply-To: <7d657461298f48d5a941df4e09887beb@git.apache.org> References: <7d657461298f48d5a941df4e09887beb@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [11/23] git commit: ACCUMULO-2005: Add a 3rd argument to functional test RunTests.java to allow a timeout factor for mapred.task.timeout and run.py -f flag ACCUMULO-2005: Add a 3rd argument to functional test RunTests.java to allow a timeout factor for mapred.task.timeout and run.py -f flag (reimplemented for 1.5.x branch) Signed-off-by: Sean Busbey Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/bc9cee0c Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/bc9cee0c Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/bc9cee0c Branch: refs/heads/ACCUMULO-2061 Commit: bc9cee0c02952a0ba6d4c96f71204e84a5acb701 Parents: 32dc104 Author: Hung Pham Authored: Sun Feb 9 18:07:30 2014 -0500 Committer: Sean Busbey Committed: Mon Mar 10 09:23:32 2014 -0500 ---------------------------------------------------------------------- .../accumulo/test/functional/RunTests.java | 21 +++++++++++++++++--- test/system/auto/README | 10 ++++++++++ 2 files changed, 28 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/accumulo/blob/bc9cee0c/test/src/main/java/org/apache/accumulo/test/functional/RunTests.java ---------------------------------------------------------------------- diff --git a/test/src/main/java/org/apache/accumulo/test/functional/RunTests.java b/test/src/main/java/org/apache/accumulo/test/functional/RunTests.java index 0f4dd8e..b70afd1 100644 --- a/test/src/main/java/org/apache/accumulo/test/functional/RunTests.java +++ b/test/src/main/java/org/apache/accumulo/test/functional/RunTests.java @@ -76,19 +76,26 @@ public class RunTests extends Configured implements Tool { private static final Logger log = Logger.getLogger(RunTests.class); private Job job = null; - + + private static final int DEFAULT_TIMEOUT_FACTOR = 1; + static class Opts extends Help { @Parameter(names="--tests", description="newline separated list of tests to run", required=true) String testFile; @Parameter(names="--output", description="destination for the results of tests in HDFS", required=true) String outputPath; + @Parameter(names="--timeoutFactor", description="Optional scaling factor for timeout for both mapred.task.timeout and -f flag on run.py", required=false) + Integer intTimeoutFactor = DEFAULT_TIMEOUT_FACTOR; } + static final String TIMEOUT_FACTOR = RunTests.class.getName() + ".timeoutFactor"; + static public class TestMapper extends Mapper { private static final String REDUCER_RESULT_START = "::::: "; private static final int RRS_LEN = REDUCER_RESULT_START.length(); private Text result = new Text(); + String mapperTimeoutFactor = null; private static enum Outcome { SUCCESS, FAILURE, ERROR, UNEXPECTED_SUCCESS, EXPECTED_FAILURE @@ -105,7 +112,7 @@ public class RunTests extends Configured implements Tool { @Override protected void map(LongWritable key, Text value, Context context) throws IOException, InterruptedException { - List cmd = Arrays.asList("/usr/bin/python", "test/system/auto/run.py", "-m", "-t", value.toString()); + List cmd = Arrays.asList("/usr/bin/python", "test/system/auto/run.py", "-m", "-f", mapperTimeoutFactor, "-t", value.toString()); log.info("Running test " + cmd); ProcessBuilder pb = new ProcessBuilder(cmd); pb.directory(new File(context.getConfiguration().get("accumulo.home"))); @@ -140,6 +147,10 @@ public class RunTests extends Configured implements Tool { p.waitFor(); } + @Override + protected void setup(Mapper.Context context) throws IOException, InterruptedException { + mapperTimeoutFactor = Integer.toString(context.getConfiguration().getInt(TIMEOUT_FACTOR, DEFAULT_TIMEOUT_FACTOR)); + } } @Override @@ -153,7 +164,11 @@ public class RunTests extends Configured implements Tool { Configuration conf = job.getConfiguration(); conf.setInt("mapred.max.split.size", 40); conf.set("accumulo.home", System.getenv("ACCUMULO_HOME")); - conf.setInt("mapred.task.timeout", 8 * 60 * 1000); + + // Taking third argument as scaling factor to setting mapred.task.timeout + // and TIMEOUT_FACTOR + conf.setInt("mapred.task.timeout", opts.intTimeoutFactor * 8 * 60 * 1000); + conf.setInt(TIMEOUT_FACTOR, opts.intTimeoutFactor); conf.setBoolean("mapred.map.tasks.speculative.execution", false); // set input http://git-wip-us.apache.org/repos/asf/accumulo/blob/bc9cee0c/test/system/auto/README ---------------------------------------------------------------------- diff --git a/test/system/auto/README b/test/system/auto/README index 41f6159..c12ca68 100644 --- a/test/system/auto/README +++ b/test/system/auto/README @@ -69,6 +69,16 @@ cluster at your disposal, you can run the tests as a MapReduce job: The example above runs every test. You can trim the tests file to include only the tests you wish to run. +You may specify a 'timeout factor' via an optional integer argument: + + $ ./bin/accumulo org.apache.accumulo.test.functional.RunTests --tests \ + /user/hadoop/tests --output /user/hadoop/results --timeoutFactor + +Where 'timeout_factor' indicates how much we should scale up timeouts. It will +be used to set both mapred.task.timeout and the "-f" flag used by run.py. If +not given, 'timeout_factor' defaults to 1, which corresponds to a +mapred.task.timeout of 480 seconds. + In some clusters, the user under which MR jobs run is different from the user under which Accumulo is installed, and this can cause failures running the tests. Various configuration and permission changes can be made to help the