From: Kienan Stewart Date: Thu, 14 Nov 2024 19:28:06 +0000 (-0500) Subject: Tests: Wait for specific PIDs of background applications X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=faaa11c1e04c5e11d94d3a920d32d72149402e25;p=lttng-tools.git Tests: Wait for specific PIDs of background applications When running lttng-relayd or any other SUT from utils.sh in a fashion that doesn't take it out of the test's process tree (e.g. when started without '-d' or '-b'), `wait` will hang on those processes are well. Change-Id: I82e0365d5165088980c0fce8e451fa0557ee201a Signed-off-by: Kienan Stewart Signed-off-by: Jérémie Galarneau --- diff --git a/tests/destructive/metadata-regeneration b/tests/destructive/metadata-regeneration index 5daa21b16..23c216e54 100755 --- a/tests/destructive/metadata-regeneration +++ b/tests/destructive/metadata-regeneration @@ -126,7 +126,7 @@ function test_ust_local () touch "${file_sync_before_last}" # Wait for the applications started in background - wait + wait "${!}" stop_lttng_tracing_ok $SESSION_NAME validate_trace_date $DATE1 "$TRACE_PATH" @@ -168,7 +168,7 @@ function test_ust_streaming () touch "${file_sync_before_last}" # Wait for the applications started in background - wait + wait "${!}" stop_lttng_tracing_ok $SESSION_NAME validate_trace_date $DATE1 $TRACE_PATH/$HOSTNAME/$SESSION_NAME* diff --git a/tests/regression/tools/exclusion/test_exclusion b/tests/regression/tools/exclusion/test_exclusion index 69347a2b2..0dead2096 100755 --- a/tests/regression/tools/exclusion/test_exclusion +++ b/tests/regression/tools/exclusion/test_exclusion @@ -122,6 +122,7 @@ function test_exclusion_tracing_started $TESTAPP_BIN -i 1 -w 10000 \ --create-in-main ${file_create_in_main} \ --wait-before-first-event ${file_wait_before_first} 2>&1 & + tracee_pids+=("${!}") while [ ! -f "${file_create_in_main}" ]; do sleep 0.5 @@ -136,7 +137,8 @@ function test_exclusion_tracing_started touch ${file_wait_before_first} # Wait for the testapp to finish. - wait + wait "${tracee_pids[@]}" + tracee_pids=() stop_lttng_tracing_ok $SESSION_NAME @@ -183,6 +185,7 @@ print_test_banner "$TEST_DESC" bail_out_if_no_babeltrace start_lttng_sessiond +tracee_pids=() diag "Enable event without exclusion" dry_run diff --git a/tests/regression/tools/live/test_ust_tracefile_count b/tests/regression/tools/live/test_ust_tracefile_count index 3225b65d6..bf6d6d1d3 100755 --- a/tests/regression/tools/live/test_ust_tracefile_count +++ b/tests/regression/tools/live/test_ust_tracefile_count @@ -52,9 +52,7 @@ start_lttng_relayd_notap "-o $TRACE_PATH" setup_live_tracing -# Run app in background $TESTAPP_BIN -i $NR_ITER -w $NR_USEC_WAIT --sync-after-first-event ${file_sync_after_first} >/dev/null 2>&1 - while [ ! -f "${file_sync_after_first}" ]; do sleep 0.5 done @@ -62,9 +60,6 @@ done # Start the live test $TESTDIR/regression/tools/live/live_test -# Wait for the applications started in background -wait - clean_live_tracing rm -f ${file_sync_after_first} diff --git a/tests/regression/tools/mi/test_mi b/tests/regression/tools/mi/test_mi index faeb3d09b..39f082e6c 100755 --- a/tests/regression/tools/mi/test_mi +++ b/tests/regression/tools/mi/test_mi @@ -538,6 +538,7 @@ function test_list_ust_event () local file_sync_after_first=$(mktemp -u -t "tmp.${FUNCNAME[0]}_sync_after_first.XXXXXX") local file_sync_before_last=$(mktemp -u -t "tmp.${FUNCNAME[0]}_sync_before_last.XXXXXX") + local pid OUTPUT_FILE="list_ust_event.xml" @@ -548,6 +549,7 @@ function test_list_ust_event () $TESTAPP_BIN -i $NR_ITER -w $NR_USEC_WAIT \ --sync-after-first-event ${file_sync_after_first} \ --sync-before-last-event ${file_sync_before_last} & 2>/dev/null + pid="${!}" while [ ! -f "${file_sync_after_first}" ]; do sleep 0.5 @@ -577,8 +579,7 @@ function test_list_ust_event () test "$num" -ge "12" ok $? "Mi test: $num / 12 ust event fields discovered" - #Wait for all background processes - wait + wait "${pid}" rm -f ${file_sync_after_first} rm -f ${file_sync_before_last} diff --git a/tests/regression/tools/regen-metadata/test_ust b/tests/regression/tools/regen-metadata/test_ust index a48221323..54931b720 100755 --- a/tests/regression/tools/regen-metadata/test_ust +++ b/tests/regression/tools/regen-metadata/test_ust @@ -42,6 +42,7 @@ function test_ust_streaming () local file_sync_after_first=$(mktemp -u -t "tmp.${FUNCNAME[0]}_sync_after_first.XXXXXX") local file_sync_before_last=$(mktemp -u -t "tmp.${FUNCNAME[0]}_sync_before_last.XXXXXX") local metadata_path + local pid diag "Test UST streaming with metadata regeneration" create_lttng_session_uri $SESSION_NAME net://localhost @@ -50,13 +51,14 @@ function test_ust_streaming () $TESTAPP_BIN -i $NR_ITER -w $NR_USEC_WAIT \ --sync-after-first-event ${file_sync_after_first} \ --sync-before-last-event ${file_sync_before_last} >/dev/null 2>&1 & + pid="${!}" start_lttng_tracing_ok $SESSION_NAME touch ${file_sync_before_last} # Wait for the applications started in background - wait + wait "${pid}" # Expect a valid trace stop_lttng_tracing_ok $SESSION_NAME @@ -86,6 +88,7 @@ function test_ust_local () local file_sync_after_first=$(mktemp -u -t "tmp.${FUNCNAME[0]}_sync_after_first.XXXXXX") local file_sync_before_last=$(mktemp -u -t "tmp.${FUNCNAME[0]}_sync_before_last.XXXXXX") local metadata_path + local pid diag "Test UST local with metadata regeneration" create_lttng_session_ok $SESSION_NAME $TRACE_PATH @@ -94,13 +97,14 @@ function test_ust_local () $TESTAPP_BIN -i $NR_ITER -w $NR_USEC_WAIT \ --sync-after-first-event ${file_sync_after_first} \ --sync-before-last-event ${file_sync_before_last} > /dev/null 2>&1 & + pid="${!}" start_lttng_tracing_ok $SESSION_NAME touch ${file_sync_before_last} # Wait for the applications started in background - wait + wait "${pid}" # Expect a valid trace stop_lttng_tracing_ok $SESSION_NAME @@ -129,6 +133,7 @@ function test_ust_pid () { local file_sync_after_first=$(mktemp -u -t "tmp.${FUNCNAME[0]}_sync_after_first.XXXXXX") local file_sync_before_last=$(mktemp -u -t "tmp.${FUNCNAME[0]}_sync_before_last.XXXXXX") + local pid diag "Test UST per-pid with metadata regeneration (expect failure)" create_lttng_session_ok $SESSION_NAME $TRACE_PATH @@ -138,13 +143,14 @@ function test_ust_pid () $TESTAPP_BIN -i $NR_ITER -w $NR_USEC_WAIT \ --sync-after-first-event ${file_sync_after_first} \ --sync-before-last-event ${file_sync_before_last} >/dev/null 2>&1 & + pid="${!}" start_lttng_tracing_ok $SESSION_NAME touch ${file_sync_before_last} # Wait for the applications started in background - wait + wait "${pid}" regenerate_metadata_fail $SESSION_NAME stop_lttng_tracing_ok $SESSION_NAME @@ -163,6 +169,7 @@ function test_ust_live () { local file_sync_after_first=$(mktemp -u -t "tmp.${FUNCNAME[0]}_sync_after_first.XXXXXX") local file_sync_before_last=$(mktemp -u -t "tmp.${FUNCNAME[0]}_sync_before_last.XXXXXX") + local pid diag "Test UST live with metadata regeneration (expect failure)" create_lttng_session_uri $SESSION_NAME net://localhost --live @@ -171,13 +178,14 @@ function test_ust_live () $TESTAPP_BIN -i $NR_ITER -w $NR_USEC_WAIT \ --sync-after-first-event ${file_sync_after_first} \ --sync-before-last-event ${file_sync_before_last} >/dev/null 2>&1 & + pid="${!}" start_lttng_tracing_ok $SESSION_NAME touch ${file_sync_before_last} # Wait for the applications started in background - wait + wait "${pid}" regenerate_metadata_fail $SESSION_NAME stop_lttng_tracing_ok $SESSION_NAME diff --git a/tests/regression/tools/relayd-grouping/test_ust b/tests/regression/tools/relayd-grouping/test_ust index 8e2dca9cc..661565283 100755 --- a/tests/regression/tools/relayd-grouping/test_ust +++ b/tests/regression/tools/relayd-grouping/test_ust @@ -389,6 +389,7 @@ function test_ust_pid_streaming_snapshot () $TESTAPP_BIN -i $NR_ITER -w $NR_USEC_WAIT \ --sync-after-first-event "$file_sync_after_first" \ --sync-before-last-event "$file_sync_before_last" 2>&1 & + pid="${!}" while [ ! -f "${file_sync_after_first}" ]; do sleep 0.5 @@ -397,7 +398,7 @@ function test_ust_pid_streaming_snapshot () lttng_snapshot_record "$session_name" touch "$file_sync_before_last" - wait + wait "${pid}" stop_lttng_tracing_ok "$session_name" destroy_lttng_session_ok "$session_name" --no-wait diff --git a/tests/regression/tools/snapshots/ust_test b/tests/regression/tools/snapshots/ust_test index e49549804..97f201442 100755 --- a/tests/regression/tools/snapshots/ust_test +++ b/tests/regression/tools/snapshots/ust_test @@ -63,10 +63,12 @@ function wait_test_apps() function stop_test_apps() { - diag "Stopping $TESTAPP_NAME" - kill "${APPS_PID[@]}" - wait "${APPS_PID[@]}" - APPS_PID=() + if [[ -n "${APPS_PID[*]}" ]]; then + diag "Stopping $TESTAPP_NAME" + kill "${APPS_PID[@]}" + wait "${APPS_PID[@]}" + APPS_PID=() + fi } function snapshot_add_output () diff --git a/tests/regression/tools/streaming/test_high_throughput_limits b/tests/regression/tools/streaming/test_high_throughput_limits index cf3a40ddc..b8b01ccb8 100755 --- a/tests/regression/tools/streaming/test_high_throughput_limits +++ b/tests/regression/tools/streaming/test_high_throughput_limits @@ -105,6 +105,7 @@ function run_apps # the status reply from the consumer quite slow thus delaying the # registration done message. LTTNG_UST_REGISTER_TIMEOUT=-1 $TESTAPP_BIN -i "$NR_ITER" >/dev/null 2>&1 & + tracee_pids+=("${!}") done } @@ -116,7 +117,8 @@ function test_high_throughput start_lttng_tracing_ok $SESSION_NAME run_apps diag "Waiting for applications to end" - wait + wait "${tracee_pids[@]}" + tracee_pids=() pass "waiting done" stop_lttng_tracing_ok $SESSION_NAME destroy_lttng_session_ok $SESSION_NAME @@ -179,6 +181,7 @@ check_skip_kernel_test "$NUM_TESTS" "Skipping all tests." || trap interrupt_cleanup SIGTERM SIGINT BW_LIMITS=(3200 400 100) + tracee_pids=() for BW in "${BW_LIMITS[@]}"; do diag "Test high-throughput with bandwidth limit set to ${BW}kbits" diff --git a/tests/regression/tools/streaming/test_ust b/tests/regression/tools/streaming/test_ust index 27f6b679b..80b461b34 100755 --- a/tests/regression/tools/streaming/test_ust +++ b/tests/regression/tools/streaming/test_ust @@ -31,6 +31,7 @@ fi function test_ust_before_start () { local file_sync_before_last=$(mktemp -u -t "tmp.test_${FUNCNAME[0]}_sync_before_last.XXXXXX") + local tracee_pids=() diag "Test UST streaming BEFORE tracing starts" create_lttng_session_uri $SESSION_NAME net://localhost @@ -38,13 +39,14 @@ function test_ust_before_start () # Run 5 times with a 1 second delay $TESTAPP_BIN -i $NR_ITER -w $NR_USEC_WAIT --sync-before-last-event ${file_sync_before_last} > /dev/null 2>&1 & + tracee_pids+=("${!}") start_lttng_tracing_ok $SESSION_NAME touch ${file_sync_before_last} # Wait for the applications started in background - wait + wait "${tracee_pids[@]}" stop_lttng_tracing_ok $SESSION_NAME destroy_lttng_session_ok $SESSION_NAME @@ -54,6 +56,7 @@ function test_ust_before_start () function test_ust_after_start () { local file_sync_after_first=$(mktemp -u -t "tmp.test_${FUNCNAME[0]}_sync_after_first.XXXXXX") + local tracee_pids=() diag "Test UST streaming AFTER tracing starts" create_lttng_session_uri $SESSION_NAME net://localhost @@ -62,7 +65,8 @@ function test_ust_after_start () # Run 5 times with a 1 second delay $TESTAPP_BIN -i $NR_ITER -w $NR_USEC_WAIT \ - --sync-after-first-event ${file_sync_after_first} >/dev/null 2>&1 + --sync-after-first-event ${file_sync_after_first} >/dev/null 2>&1 + tracee_pids+=("${!}") while [ ! -f "${file_sync_after_first}" ]; do sleep 0.5 @@ -72,7 +76,7 @@ function test_ust_after_start () destroy_lttng_session_ok $SESSION_NAME # Wait for the applications started in background - wait + wait "${tracee_pids[@]}" rm -f ${file_sync_after_first} } diff --git a/tests/regression/ust/before-after/test_before_after b/tests/regression/ust/before-after/test_before_after index f7b954779..f81c2b513 100755 --- a/tests/regression/ust/before-after/test_before_after +++ b/tests/regression/ust/before-after/test_before_after @@ -33,7 +33,7 @@ function test_before_apps() start_lttng_tracing_ok $SESSION_NAME $TESTAPP_BIN -i $NR_ITER -w $NR_USEC_WAIT & - wait + wait "${!}" ok $? "Traced application stopped." stop_lttng_tracing_ok $SESSION_NAME @@ -62,7 +62,7 @@ function test_after_apps() touch ${file_sync_before_last} - wait + wait "${!}" stop_lttng_tracing_ok $SESSION_NAME destroy_lttng_session_ok $SESSION_NAME diff --git a/tests/regression/ust/buffers-pid/test_buffers_pid b/tests/regression/ust/buffers-pid/test_buffers_pid index a18cdbf05..fcc8a871e 100755 --- a/tests/regression/ust/buffers-pid/test_buffers_pid +++ b/tests/regression/ust/buffers-pid/test_buffers_pid @@ -38,6 +38,7 @@ function enable_channel_per_pid() test_after_multiple_apps() { local out local i + local tracee_pids=() diag "Start multiple applications AFTER tracing is started" @@ -50,8 +51,9 @@ test_after_multiple_apps() { for i in `seq 1 5`; do $TESTAPP_BIN -i $NR_ITER -w $NR_USEC_WAIT >/dev/null 2>&1 & ok $? "Start application $i for tracing" + tracee_pids+=("${!}") done - wait + wait "${tracee_pids[@]}" stop_lttng_tracing_ok $SESSION_NAME destroy_lttng_session_ok $SESSION_NAME @@ -64,6 +66,7 @@ test_after_multiple_apps() { test_before_multiple_apps() { local out local i + local tracee_pids=() local file_sync_after_first=$(mktemp -u -t "tmp.${FUNCNAME[0]}_sync_after_first.XXXXXX") local file_sync_before_last=$(mktemp -u -t "tmp.${FUNCNAME[0]}_sync_before_last.XXXXXX") @@ -74,6 +77,7 @@ test_before_multiple_apps() { --sync-after-first-event ${file_sync_after_first}_${i} \ --sync-before-last-event ${file_sync_before_last}_${i} >/dev/null 2>&1 & ok $? "Start application $i for tracing" + tracee_pids+=("${!}") done # BEFORE application is spawned @@ -87,7 +91,7 @@ test_before_multiple_apps() { done diag "Waiting for applications to end" - wait + wait "${tracee_pids[@]}" pass "Waiting done" stop_lttng_tracing_ok $SESSION_NAME @@ -125,7 +129,7 @@ test_after_app() { $TESTAPP_BIN -i $NR_ITER -w $NR_USEC_WAIT & ok $? "Start application to trace" - wait + wait "${!}" stop_lttng_tracing_ok $SESSION_NAME destroy_lttng_session_ok $SESSION_NAME @@ -137,6 +141,7 @@ test_after_app() { test_before_app() { local out + local pid local file_sync_after_first=$(mktemp -u -t "tmp.${FUNCNAME[0]}_sync_after_first.XXXXXX") local file_sync_before_last=$(mktemp -u -t "tmp.${FUNCNAME[0]}_sync_before_last.XXXXXX") @@ -152,12 +157,13 @@ test_before_app() { --sync-after-first-event ${file_sync_after_first} \ --sync-before-last-event ${file_sync_before_last} & ok $? "Start application to trace" + pid="${!}" start_lttng_tracing_ok $SESSION_NAME touch ${file_sync_before_last} - wait + wait "${pid}" stop_lttng_tracing_ok $SESSION_NAME destroy_lttng_session_ok $SESSION_NAME @@ -206,7 +212,7 @@ test_multiple_channels() { $TESTAPP_BIN -i $NR_ITER -w $NR_USEC_WAIT & ok $? "Start application to trace" - wait + wait "${!}" stop_lttng_tracing_ok $SESSION_NAME trace_match_only $EVENT_NAME $[NR_ITER * 5] $TRACE_PATH diff --git a/tests/regression/ust/high-throughput/test_high_throughput b/tests/regression/ust/high-throughput/test_high_throughput index 750445a48..7ddfc416c 100755 --- a/tests/regression/ust/high-throughput/test_high_throughput +++ b/tests/regression/ust/high-throughput/test_high_throughput @@ -37,12 +37,14 @@ create_lttng_session_ok $SESSION_NAME $TRACE_PATH enable_ust_lttng_event_ok $SESSION_NAME $EVENT_NAME start_lttng_tracing_ok $SESSION_NAME +pids=() for i in `seq 1 $NR_APP`; do ./$CURDIR/$BIN_NAME >/dev/null 2>&1 & + pids+=("${!}") done diag "Waiting for applications to end" -wait +wait "${pids[@]}" pass "Wait for applications to end" stop_lttng_tracing_ok $SESSION_NAME diff --git a/tests/regression/ust/java-jul/test_java_jul b/tests/regression/ust/java-jul/test_java_jul index 41e2656ff..a4bc85206 100755 --- a/tests/regression/ust/java-jul/test_java_jul +++ b/tests/regression/ust/java-jul/test_java_jul @@ -34,6 +34,7 @@ function run_app function run_app_background { run_app $@ & + tracee_pids+=("${!}") } function enable_jul_loglevel_only() @@ -94,7 +95,8 @@ function test_jul_before_start () touch ${file_sync_before_last} # Wait for the applications started in background - wait + wait "${tracee_pids[@]}" + tracee_pids=() stop_lttng_tracing_ok $SESSION_NAME destroy_lttng_session_ok $SESSION_NAME @@ -511,7 +513,7 @@ function test_jul_destroy_session() run_app_background 0 1 # Wait for the applications started in background - wait + wait "${tracee_pids[@]}" stop_lttng_tracing_ok $SESSION_NAME destroy_lttng_session_ok $SESSION_NAME @@ -530,7 +532,7 @@ function test_jul_destroy_session() run_app_background 0 1 # Wait for the applications started in background - wait + wait "${tracee_pids[@]}" stop_lttng_tracing_ok $SESSION_NAME destroy_lttng_session_ok $SESSION_NAME @@ -670,6 +672,7 @@ else withapp=1 fi +tracee_pids=() skip $withapp "JUL support is needed. Skipping all tests." $NUM_TESTS || { start_lttng_sessiond diff --git a/tests/regression/ust/java-log4j/test_java_log4j b/tests/regression/ust/java-log4j/test_java_log4j index fc857b1bd..b2e55c434 100755 --- a/tests/regression/ust/java-log4j/test_java_log4j +++ b/tests/regression/ust/java-log4j/test_java_log4j @@ -47,6 +47,7 @@ function run_app function run_app_background { run_app "${@}" & + tracee_pids+=("${!}") } @@ -72,7 +73,8 @@ function test_log4j_before_start () touch "${file_sync_before_last}" # Wait for the applications started in background - wait + wait "${tracee_pids[@]}" + tracee_pids=() stop_lttng_tracing_ok $SESSION_NAME destroy_lttng_session_ok $SESSION_NAME @@ -421,7 +423,8 @@ function test_log4j_destroy_session() # Run 5 times with a 1 second delay run_app_background 0 1 # Wait for the applications started in background - wait + wait "${tracee_pids[@]}" + tracee_pids=() stop_lttng_tracing_ok $SESSION_NAME destroy_lttng_session_ok $SESSION_NAME @@ -436,7 +439,8 @@ function test_log4j_destroy_session() # Run 5 times with a 1 second delay run_app_background 0 1 # Wait for the applications started in background - wait + wait "${tracee_pids[@]}" + tracee_pids=() stop_lttng_tracing_ok $SESSION_NAME destroy_lttng_session_ok $SESSION_NAME @@ -577,6 +581,7 @@ tests=( test_log4j_filter_loglevel ) +tracee_pids=() for fct_test in "${tests[@]}"; do TRACE_PATH=$(mktemp -d -t tmp.test_java_log4j_trace_path.XXXXXX) diff --git a/tests/regression/ust/java-log4j2/test_agent_log4j2_domain_log4j b/tests/regression/ust/java-log4j2/test_agent_log4j2_domain_log4j index 862e4be98..0d8b392b4 100755 --- a/tests/regression/ust/java-log4j2/test_agent_log4j2_domain_log4j +++ b/tests/regression/ust/java-log4j2/test_agent_log4j2_domain_log4j @@ -48,6 +48,7 @@ function run_app function run_app_background { run_app "${@}" & + tracee_pids+=("${!}") } @@ -73,7 +74,8 @@ function test_log4j2_before_start () touch "${file_sync_before_last}" # Wait for the applications started in background - wait + wait "${tracee_pids[@]}" + tracee_pids=() stop_lttng_tracing_ok "log4j2_before_start" destroy_lttng_session_ok "log4j2_before_start" @@ -422,7 +424,8 @@ function test_log4j2_destroy_session() # Run 5 times with a 1ms delay run_app_background 0 1 # Wait for the applications started in background - wait + wait "${tracee_pids[@]}" + tracee_pids=() stop_lttng_tracing_ok "log4j2_destroy_session" destroy_lttng_session_ok "log4j2_destroy_session" @@ -437,7 +440,8 @@ function test_log4j2_destroy_session() # Run 5 times with a 1ms delay run_app_background 0 1 # Wait for the applications started in background - wait + wait "${tracee_pids[@]}" + tracee_pids=() stop_lttng_tracing_ok "log4j2_destroy_session" destroy_lttng_session_ok "log4j2_destroy_session" @@ -578,6 +582,7 @@ tests=( test_log4j2_filter_loglevel ) +tracee_pids=() for fct_test in "${tests[@]}"; do TRACE_PATH=$(mktemp -d -t tmp.test_java_log4j2_trace_path.XXXXXX) diff --git a/tests/regression/ust/java-log4j2/test_agent_log4j2_domain_log4j2 b/tests/regression/ust/java-log4j2/test_agent_log4j2_domain_log4j2 index c9b12d137..1e3fa44e2 100755 --- a/tests/regression/ust/java-log4j2/test_agent_log4j2_domain_log4j2 +++ b/tests/regression/ust/java-log4j2/test_agent_log4j2_domain_log4j2 @@ -51,6 +51,7 @@ function run_app function run_app_background { run_app "${@}" & + tracee_pids+=("${!}") } @@ -76,7 +77,8 @@ function test_log4j2_before_start () touch "${file_sync_before_last}" # Wait for the applications started in background - wait + wait "${tracee_pids[@]}" + tracee_pids=() stop_lttng_tracing_ok "log4j2_before_start" destroy_lttng_session_ok "log4j2_before_start" @@ -425,7 +427,8 @@ function test_log4j2_destroy_session() # Run 5 times with a 1ms delay run_app_background 0 1 # Wait for the applications started in background - wait + wait "${tracee_pids[@]}" + tracee_pids=() stop_lttng_tracing_ok "log4j2_destroy_session" destroy_lttng_session_ok "log4j2_destroy_session" @@ -440,7 +443,8 @@ function test_log4j2_destroy_session() # Run 5 times with a 1ms delay run_app_background 0 1 # Wait for the applications started in background - wait + wait "${tracee_pids[@]}" + tracee_pids=() stop_lttng_tracing_ok "log4j2_destroy_session" destroy_lttng_session_ok "log4j2_destroy_session" @@ -581,6 +585,7 @@ tests=( test_log4j2_filter_loglevel ) +tracee_pids=() for fct_test in "${tests[@]}"; do TRACE_PATH=$(mktemp --tmpdir -d tmp.test_java_log4j2_trace_path.XXXXXX) diff --git a/tests/regression/ust/multi-session/test_multi_session b/tests/regression/ust/multi-session/test_multi_session index e407859c4..7571e43bb 100755 --- a/tests/regression/ust/multi-session/test_multi_session +++ b/tests/regression/ust/multi-session/test_multi_session @@ -34,8 +34,7 @@ test_multi_session() { "./$CURDIR/gen-nevents" $NR_ITER & ok $? "Start application to generate $NR_ITER events" - - wait + wait "${!}" pass "Wait for events to record" for i in $(seq 0 3); do diff --git a/tests/regression/ust/python-logging/test_python_logging.in b/tests/regression/ust/python-logging/test_python_logging.in index dc7cfaba6..c5ac818d0 100755 --- a/tests/regression/ust/python-logging/test_python_logging.in +++ b/tests/regression/ust/python-logging/test_python_logging.in @@ -61,6 +61,7 @@ function run_app function run_app_background { run_app "$@" & + tracee_pids+=("${!}") } function enable_python_loglevel_only() @@ -129,7 +130,7 @@ function test_python_before_start () # Wait for the applications started in background echo "1" > ${go_file} - wait + wait "${tracee_pids[@]}" stop_lttng_tracing_ok $SESSION_NAME destroy_lttng_session_ok $SESSION_NAME @@ -762,6 +763,7 @@ else skip_agent=1 fi +tracee_pids=() skip $skip_agent "Python agent test skipped." $NUM_TESTS || { start_lttng_sessiond