From 908ee7bde57e486452a60c907f65cea3f8107d51 Mon Sep 17 00:00:00 2001 From: David Goulet Date: Thu, 12 Apr 2012 14:54:28 -0400 Subject: [PATCH] Wait for all apps in high-throughput test Don't wait an arbitrary amount of time for application to end. Signed-off-by: David Goulet --- tests/ust/high-throughput/run | 9 ++++++--- tests/utils.sh | 2 +- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/tests/ust/high-throughput/run b/tests/ust/high-throughput/run index 05f8e85ea..de3111ddd 100755 --- a/tests/ust/high-throughput/run +++ b/tests/ust/high-throughput/run @@ -48,9 +48,12 @@ for i in `seq 1 $NR_ITER`; do ./$CURDIR/$BIN_NAME & >/dev/null 2>&1 done -echo "Waiting for all tracing to settle (7 secs)" -echo "Warning: this arbitrary time can make the test fail on slower system" -sleep 7 +echo "Waiting for applications to end" +while [ -n "$(pidof $BIN_NAME)" ]; do + echo -n "." + sleep 0.5 +done +echo "" stop_tracing $SESSION_NAME destroy_lttng_session $SESSION_NAME diff --git a/tests/utils.sh b/tests/utils.sh index 0f4affd99..9f2f629b4 100644 --- a/tests/utils.sh +++ b/tests/utils.sh @@ -115,7 +115,7 @@ function create_lttng_session () sess_name=$1 trace_path=$2 - echo -n "Creating lttng session $sess_name in $trace_path" + echo -n "Creating lttng session $sess_name in $trace_path " $TESTDIR/../src/bin/lttng/$LTTNG_BIN create $sess_name -o $trace_path >/dev/null 2>&1 if [ $? -eq 1 ]; then echo -e "\e[1;31mFAILED\e[0m" -- 2.34.1