tests: tools/clear/test_ust wait for specific test app pid
authorKienan Stewart <kstewart@efficios.com>
Tue, 19 Dec 2023 19:01:47 +0000 (14:01 -0500)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Thu, 28 Mar 2024 18:37:39 +0000 (14:37 -0400)
Observed issue
==============

When debugging failing tests manually, one step that is sometimes done
is to quickly swap the commands that start the relay or sessiond in
`tests/utils/utils.sh` (eg. in `start_lttng_relayd_opt`) for the version
which uses a verbose output to a logfile.

When doing this, the `relayd` wasn't using the background
`process_mode`, and was a child of the running test.

This caused `test_ust_local_snapshot_per_pid` in
`tests/regression/tools/clear/test_ust` to hang as it waited for all
child processes to terminate.

Solution
========

The test has been updated to wait for only the specific test application
pid.

Known drawbacks
===============

None.

Change-Id: I8761649a52fceda92a5545c71818dc2eb027bfcf
Signed-off-by: Kienan Stewart <kstewart@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
tests/regression/tools/clear/test_ust
tests/utils/utils.sh

index f825e6321017ac6314e11bbe5796b50c25a69732..8bd8b32200cb72f0755638099d47e19c2f50e253 100755 (executable)
@@ -639,6 +639,7 @@ function test_ust_local_snapshot_per_pid ()
                --sync-before-last-event-touch ${file_sync_before_last_touch} \
                --sync-before-exit ${file_sync_before_exit} \
                --sync-before-exit-touch ${file_sync_before_exit_touch} >/dev/null 2>&1 &
+       local app_pid="${!}"
 
        # Continue only when there is only the last event remaining.
        while [ ! -f "${file_sync_before_last_touch}" ]; do
@@ -682,7 +683,7 @@ function test_ust_local_snapshot_per_pid ()
 
        # Release the application.
        touch ${file_sync_before_exit}
-       wait
+       wait "${app_pid}"
        destroy_lttng_session_ok $SESSION_NAME
 
        rm -f ${file_sync_before_last}
index 004e90948f20f7df44be56587d1a08923806bf97..9e0175ced8e60bfe57b7eb46e83c060d9da791ac 100644 (file)
@@ -522,7 +522,7 @@ function start_lttng_relayd_opt()
        if [ -z $(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)"
This page took 0.026616 seconds and 4 git commands to generate.