Fix: test flaky sleep and wait patterns
[lttng-tools.git] / tests / regression / ust / java-jul / test_java_jul
index bf3bb0bc27dfa4820877acbe031f9bc84bebc2b2..62b58a0380eb2ee7047c41a3a3e7a04356cb34ae 100755 (executable)
@@ -90,7 +90,8 @@ function test_jul_before_start ()
 
        start_lttng_tracing $SESSION_NAME
 
-       wait_apps
+       # Wait for the applications started in background
+       wait
 
        stop_lttng_tracing $SESSION_NAME
        destroy_lttng_session $SESSION_NAME
@@ -285,13 +286,13 @@ function test_jul_multi_session_disable()
        destroy_lttng_session $SESSION_NAME-2
 
        # Validate test. Expecting one event of the second TP.
-       trace_matches $EVENT_NAME2 1 $TRACE_PATH/$SESSION_NAME-1
+       trace_match_only $EVENT_NAME2 1 $TRACE_PATH/$SESSION_NAME-1
        if [ $? -ne 0 ]; then
                return $?
        fi
 
        # Validate test. Expecting one event of the second TP.
-       trace_matches $EVENT_NAME2 1 $TRACE_PATH/$SESSION_NAME-2
+       trace_match_only $EVENT_NAME2 1 $TRACE_PATH/$SESSION_NAME-2
        if [ $? -ne 0 ]; then
                return $?
        fi
@@ -342,7 +343,8 @@ function test_jul_destroy_session()
        # Run 5 times with a 1 second delay
        run_app 0 1
 
-       sleep 1
+       # Wait for the applications started in background
+       wait
 
        stop_lttng_tracing $SESSION_NAME
        destroy_lttng_session $SESSION_NAME
@@ -357,7 +359,11 @@ function test_jul_destroy_session()
        enable_jul_lttng_event $SESSION_NAME $EVENT_NAME2
        start_lttng_tracing $SESSION_NAME
 
-       wait_apps
+       # Run 5 times with a 1 second delay
+       run_app_background 0 1
+
+       # Wait for the applications started in background
+       wait
 
        stop_lttng_tracing $SESSION_NAME
        destroy_lttng_session $SESSION_NAME
@@ -430,7 +436,7 @@ function test_jul_disable()
        destroy_lttng_session $SESSION_NAME
 
        # Validate test. Expecting one event of the second TP only.
-       trace_matches $EVENT_NAME2 1 $TRACE_PATH/$SESSION_NAME
+       trace_match_only $EVENT_NAME2 1 $TRACE_PATH/$SESSION_NAME
        if [ $? -ne 0 ]; then
                return $?
        fi
@@ -455,7 +461,7 @@ function test_jul_disable_enable()
        destroy_lttng_session $SESSION_NAME
 
        # Validate test. Expecting NR_ITER event of the main INFO tp.
-       trace_matches $EVENT_NAME $NR_ITER $TRACE_PATH/$SESSION_NAME
+       trace_match_only $EVENT_NAME $NR_ITER $TRACE_PATH/$SESSION_NAME
        if [ $? -ne 0 ]; then
                return $?
        fi
This page took 0.024154 seconds and 4 git commands to generate.