From cd026d6dd71085c6f1fa91d5a27216b9ab86b39a Mon Sep 17 00:00:00 2001 From: Prithvi Prabhu Date: Thu, 17 Dec 2015 18:04:55 -0800 Subject: [PATCH] Default Flow runner timeout to Infinity --- scripts/run-flow.coffee | 11 +++++++---- scripts/run-flow.js | 8 ++++---- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/scripts/run-flow.coffee b/scripts/run-flow.coffee index 3e4a6b45a4a6..67c7ff1b86a5 100644 --- a/scripts/run-flow.coffee +++ b/scripts/run-flow.coffee @@ -19,8 +19,8 @@ phantom.onError = (message, stacktrace) -> printUsageAndExit = (message) -> console.log "*** #{message} ***" console.log 'Usage: phantomjs run-flow.js [--host ip:port] [--timeout seconds] --flow experiment.flow' - console.log ' --host ip:port of a running H2O cloud Defaults to localhost:54321' - console.log ' --timeout max allowed runtime Defaults to 3600' + console.log ' --host ip:port of a running H2O cloud Defaults to localhost:54321' + console.log ' --timeout max allowed runtime in seconds Defaults to forever' phantom.exit 1 parseOpts = (args) -> @@ -40,9 +40,12 @@ hostname = opts['--host'] ? 'localhost:54321' console.log "Using host #{hostname}" timeout = if timeoutArg = opts['--timeout'] - 1000 * parseInt timeoutArg, 10 + timeoutSecs = parseInt timeoutArg, 10 + if isNaN timeoutSecs + printUsageAndExit "Invalid --timeout: #{timeoutArg}" + 1000 * timeoutSecs else - 3600000 + Infinity console.log "Using timeout #{timeout}ms" diff --git a/scripts/run-flow.js b/scripts/run-flow.js index 4bd277029372..d283313071f0 100644 --- a/scripts/run-flow.js +++ b/scripts/run-flow.js @@ -1,6 +1,6 @@ // Generated by CoffeeScript 1.9.3 (function() { - var error, flowContents, flowFile, fs, hostname, opts, page, parseOpts, printUsageAndExit, ref, system, timeout, timeoutArg, waitFor, webpage; + var error, flowContents, flowFile, fs, hostname, opts, page, parseOpts, printUsageAndExit, ref, system, timeout, timeoutArg, timeoutSecs, waitFor, webpage; system = require('system'); @@ -28,8 +28,8 @@ printUsageAndExit = function(message) { console.log("*** " + message + " ***"); console.log('Usage: phantomjs run-flow.js [--host ip:port] [--timeout seconds] --flow experiment.flow'); - console.log(' --host ip:port of a running H2O cloud Defaults to localhost:54321'); - console.log(' --timeout max allowed runtime Defaults to 3600'); + console.log(' --host ip:port of a running H2O cloud Defaults to localhost:54321'); + console.log(' --timeout max allowed runtime in seconds Defaults to forever'); return phantom.exit(1); }; @@ -59,7 +59,7 @@ console.log("Using host " + hostname); - timeout = (timeoutArg = opts['--timeout']) ? 1000 * parseInt(timeoutArg, 10) : 3600000; + timeout = (timeoutArg = opts['--timeout']) ? (timeoutSecs = parseInt(timeoutArg, 10), isNaN(timeoutSecs) ? printUsageAndExit("Invalid --timeout: " + timeoutArg) : void 0, 1000 * timeoutSecs) : Infinity; console.log("Using timeout " + timeout + "ms");