Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/moses-smt/vowpal_wabbit.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xtest/daemon-test.sh14
1 files changed, 12 insertions, 2 deletions
diff --git a/test/daemon-test.sh b/test/daemon-test.sh
index 8a06372d..8c35fc1f 100755
--- a/test/daemon-test.sh
+++ b/test/daemon-test.sh
@@ -39,6 +39,16 @@ else
exit 1
fi
+#
+# fractional seconds sleep
+#
+mysleep() {
+ case "$1" in
+ *[0-9]*) Seconds="$1" ;;
+ *) Seconds=0.2 ;;
+ esac
+ perl -e "select(undef,undef,undef,$Seconds)"
+}
# A command and pattern that will unlikely to match anything but our own test
DaemonCmd="$VW -t -i $MODEL --daemon --num_children 1 --quiet --port $PORT"
@@ -48,8 +58,8 @@ stop_daemon() {
# echo stopping daemon
$PKILL -9 -f "$DaemonCmd" 2>&1 | grep -q 'no process found'
# relinquish CPU by forcing some conext switches to be safe
- # (let existing vw daemon procs die)
- wait
+ # (to let existing vw daemon procs die)
+ mysleep 0.05
}
start_daemon() {