Tests: fix health tests to use custom socket timeout
[lttng-tools.git] / tests / regression / tools / health / test_thread_stall
index 1651c021e2f486dea4de1c84fdb8c9cbf40073c9..ddaab9542bf98d32ba73d55f89bbec246e8e8d62 100755 (executable)
@@ -24,12 +24,10 @@ SESSION_NAME="health_thread_stall"
 EVENT_NAME="bogus"
 HEALTH_CHECK_BIN="health_check"
 SESSIOND_PRELOAD=".libs/libhealthstall.so"
-NUM_TESTS=11
+NUM_TESTS=12
 
 source $TESTDIR/utils/utils.sh
 
-print_test_banner "$TEST_DESC"
-
 if [ ! -f "$CURDIR/$SESSIOND_PRELOAD" ]; then
        BAIL_OUT "libhealthstall.so not available for this test."
 fi
@@ -49,6 +47,8 @@ function test_thread_stall
 
        # Spawn sessiond with preload healthexit lib
        export LD_PRELOAD="$CURDIR/$SESSIOND_PRELOAD"
+       # Set the socket timeout to 5 so the health check delta is set to 25.
+       export LTTNG_NETWORK_SOCKET_TIMEOUT=5
        start_lttng_sessiond
 
        # Cleanup some env. var.
@@ -59,7 +59,7 @@ function test_thread_stall
        $CURDIR/$HEALTH_CHECK_BIN &> /dev/null
 
        # Wait
-       sleep 25
+       sleep 30
 
        # Check health status, exit code should indicate failure
        $CURDIR/$HEALTH_CHECK_BIN &> /dev/null
@@ -99,6 +99,8 @@ function test_thread_stall
 
 plan_tests $NUM_TESTS
 
+print_test_banner "$TEST_DESC"
+
 THREAD=("LTTNG_THREAD_MANAGE_CLIENTS"
        "LTTNG_THREAD_MANAGE_APPS"
 # This thread is a little bit tricky to stall,
@@ -131,7 +133,7 @@ else
        isroot=0
 fi
 
-skip $isroot "Root access is needed. Skipping LTTNG_THREAD_MANAGE_KERNEL tests." "3" ||
+skip $isroot "Root access is needed. Skipping LTTNG_THREAD_MANAGE_KERNEL tests." "4" ||
 {
        test_thread_stall "LTTNG_THREAD_MANAGE_KERNEL" "8"
 }
This page took 0.026263 seconds and 5 git commands to generate.