tests: Reduce sleep time when waiting for various daemons to die
[lttng-tools.git] / tests / utils / utils.sh
index 44b3f167a8bb54a078c25370018eeee1533878e8..27816deddd9c25b1581515471e58ee76c00dd761 100644 (file)
@@ -633,7 +633,7 @@ function start_lttng_relayd_opt()
        if [ -z $(lttng_pgrep "$RELAYD_MATCH") ]; then
                # shellcheck disable=SC2086
                $DIR/../src/bin/lttng-relayd/$RELAYD_BIN $process_mode $opt 1> $OUTPUT_DEST 2> $ERROR_OUTPUT_DEST
-               #$DIR/../src/bin/lttng-relayd/$RELAYD_BIN $opt -vvv >>/tmp/relayd.log 2>&1 &
+               #$DIR/../src/bin/lttng-relayd/$RELAYD_BIN $process_mode $opt -vvv >>/tmp/relayd.log 2>&1 &
                if [ $? -eq 1 ]; then
                        if [ $withtap -eq "1" ]; then
                                fail "Start lttng-relayd (process mode: $process_mode opt: $opt)"
@@ -675,8 +675,9 @@ function stop_lttng_relayd_opt()
 
 
        # Multiply time by 2 to simplify integer arithmetic
+       # Multiply time by 5 to adjust for sleeping every 0.1s
        if [ -n "$timeout_s" ]; then
-               dtimeleft_s=$((timeout_s * 2))
+               dtimeleft_s=$((timeout_s * 2 * 5))
        fi
 
 
@@ -711,7 +712,7 @@ function stop_lttng_relayd_opt()
                                fi
                                dtimeleft_s=$((dtimeleft_s - 1))
                        fi
-                       sleep 0.5
+                       sleep 0.1
                done
                if [ "$withtap" -eq "1" ]; then
                        if [ "$retval" -eq "0" ]; then
@@ -835,8 +836,9 @@ function stop_lttng_sessiond_opt()
        fi
 
        # Multiply time by 2 to simplify integer arithmetic
+       # Multiply time by 5 to adjust for sleeping every 0.1s
        if [ -n "$timeout_s" ]; then
-               dtimeleft_s=$((timeout_s * 2))
+               dtimeleft_s=$((timeout_s * 2 * 5))
        fi
 
        if [ -n "$TEST_NO_SESSIOND" ] && [ "$TEST_NO_SESSIOND" == "1" ]; then
@@ -881,7 +883,7 @@ function stop_lttng_sessiond_opt()
                                fi
                                dtimeleft_s=$((dtimeleft_s - 1))
                        fi
-                       sleep 0.5
+                       sleep 0.1
                done
                out=1
                while [ -n "$out" ]; do
@@ -893,7 +895,7 @@ function stop_lttng_sessiond_opt()
                                fi
                                dtimeleft_s=$((dtimeleft_s - 1))
                        fi
-                       sleep 0.5
+                       sleep 0.1
                done
 
                if [ "$withtap" -eq "1" ]; then
@@ -1003,8 +1005,9 @@ function stop_lttng_consumerd_opt()
        fi
 
        # Multiply time by 2 to simplify integer arithmetic
+       # Multiply time by 5 to adjust for sleeping every 0.1s
        if [ -n "$timeout_s" ]; then
-               dtimeleft_s=$((timeout_s * 2))
+               dtimeleft_s=$((timeout_s * 2 * 5))
        fi
 
        pids="$(lttng_pgrep "$CONSUMERD_MATCH")"
@@ -1049,7 +1052,7 @@ function stop_lttng_consumerd_opt()
                                fi
                                dtimeleft_s=$((dtimeleft_s - 1))
                        fi
-                       sleep 0.5
+                       sleep 0.1
                done
                if [ "$withtap" -eq "1" ]; then
                        if [ "$retval" -eq "0" ]; then
@@ -1995,7 +1998,7 @@ function wait_live_trace_ready ()
        diag "Waiting for live trace at url: $url"
        while [ $zero_client_match -eq 0 ]; do
                zero_client_match=$($BABELTRACE_BIN -i lttng-live $url | grep "0 client(s) connected" | wc -l)
-               sleep 0.5
+               sleep 0.1
        done
        pass "Waiting for live trace at url: $url"
 }
@@ -2008,7 +2011,7 @@ function wait_live_viewer_connect ()
        diag "Waiting for live viewers on url: $url"
        while [ $one_client_match -eq 0 ]; do
                one_client_match=$($BABELTRACE_BIN -i lttng-live $url | grep "1 client(s) connected" | wc -l)
-               sleep 0.5
+               sleep 0.1
        done
        pass "Waiting for live viewers on url: $url"
 }
This page took 0.025072 seconds and 4 git commands to generate.