Fix: add missing synchronization point for before app test case
[lttng-tools.git] / tests / regression / ust / java-jul / test_java_jul
index d16880f277aa77ad9da5d10d8630340be3957c5a..d32d9ed4564e9901b639b0588f2f3bdf217e6f61 100755 (executable)
@@ -38,6 +38,7 @@ function run_app
        local finest_tp=$1
        local fire_second_tp=$2
 
+       #FIXME: app should have synchro.
        java -cp $JAVA_CP -Djava.library.path="/usr/local/lib:/usr/lib" $TESTAPP_NAME $NR_ITER $NR_MSEC_WAIT $finest_tp $fire_second_tp >/dev/null 2>&1
 }
 
@@ -89,6 +90,9 @@ function enable_jul_filter_loglevel_only()
 
 function test_jul_before_start ()
 {
+       local file_sync_after_first=$(mktemp -u)
+       local file_sync_before_last=$(mktemp -u)
+
        diag "Test JUL application BEFORE tracing starts"
        create_lttng_session $SESSION_NAME $TRACE_PATH
        enable_jul_lttng_event $SESSION_NAME $EVENT_NAME
@@ -96,16 +100,19 @@ function test_jul_before_start ()
        # Run 5 times with a 1 second delay
        run_app_background
 
-       #FIXME: racy missing synchronization
-
        start_lttng_tracing $SESSION_NAME
 
+       touch ${file_sync_before_last}
+
        # Wait for the applications started in background
        wait
 
        stop_lttng_tracing $SESSION_NAME
        destroy_lttng_session $SESSION_NAME
 
+       rm -f ${file_sync_after_first}
+       rm -f ${file_sync_before_last}
+
        # Validate test. Expecting all events.
        trace_match_only $EVENT_NAME $NR_ITER $TRACE_PATH
        if [ $? -ne 0 ]; then
This page took 0.023455 seconds and 4 git commands to generate.