From 16ede48831b9573ca01ea2623ed3673c5d0032c3 Mon Sep 17 00:00:00 2001 From: Steve Vinoski Date: Wed, 25 May 2011 11:13:31 -0400 Subject: [PATCH] increase default maximum wait-started time Increase the default maximum time for the yaws --wait-started option from 6 seconds to 30 seconds. The test suite was seeing random failures due to 6 second wait not being enough. (The option doesn't mean it waits for 30 seconds every time, just that it will wait for a maximum of 30 seconds for yaws with the specified id to start.) --- man/yaws.1 | 4 ++-- scripts/yaws.template | 4 ++-- src/yaws_ctl.erl | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/man/yaws.1 b/man/yaws.1 index 84a493fee..fb732a1e0 100644 --- a/man/yaws.1 +++ b/man/yaws.1 @@ -199,9 +199,9 @@ for debug purposes into the logdir. .TP \fB--wait-started[=T] [--id ID] \fR -Waits at most 5 seconds for the server to start. Exits with 0 if +Waits at most 30 seconds for the server to start. Exits with 0 if server is running, 1 otherwise. Typically useful in test scripts. The -default 5 seconds can be modified by appending \fI=T\fR to the option, +default 30 seconds can be modified by appending \fI=T\fR to the option, where \fIT\fR is the desired number of seconds to wait for the server to start. diff --git a/scripts/yaws.template b/scripts/yaws.template index 75ff94d02..2e85e521f 100755 --- a/scripts/yaws.template +++ b/scripts/yaws.template @@ -168,13 +168,13 @@ while [ $# -gt 0 ] daemon=" -detached ";; --wait-started=*) call_wait_started=`echo $arg | sed -e 's/--wait-started=//'` - num=`expr "$call_wait_started" : "([0-9]*)"` + num=`expr "$call_wait_started" : "\([0-9]*\)"` if [ "$num" != "$call_wait_started" ]; then echo error: argument to --wait-started is $call_wait_started, not a number exit 1 fi;; --wait-started) - call_wait_started=6;; + call_wait_started=30;; -d|--debug) debug=" -boot start_sasl -yaws debug ";; --nodebug) diff --git a/src/yaws_ctl.erl b/src/yaws_ctl.erl index abe02639b..2ca42766e 100644 --- a/src/yaws_ctl.erl +++ b/src/yaws_ctl.erl @@ -408,7 +408,7 @@ actl(SID, Term) -> {error, eacces} -> io:format("Another user is using the yaws sid <~p>, ~n" "You are not allowd to read the file <~s>, ~n" - "specify by <-I id> which yaws system you want " + "specify by <-I id> which yaws system you want" " to control~n", [SID, yaws:ctl_file(SID)]), timer:sleep(10), @@ -420,7 +420,7 @@ actl(SID, Term) -> {error, Reason} -> io:format("You failed to read the ctlfile ~s~n" "error was: <~p>~n" - "specify by <-I id> which yaws system you want " + "specify by <-I id> which yaws system you want" " to control~n", [yaws:ctl_file(SID), Reason]), timer:sleep(10),