Add assertions to check the systemtap process in background.

Add the `-p PID` option to the `rlWaitForCmd`. The option checks the PID is
alive during the waiting.
See <cfa801fb17/src/synchronisation.sh (L194-L202)>
for the logic of the `-p` option.

Add an assertion to check the systemtap process after systemtap logging the
the text "starting run" before running the assertions for ruby commands. Because
systemtap can fail after logging the text as a possibility.

An example of the failure: https://access.redhat.com/solutions/3613871
This commit is contained in:
Jun Aruga 2024-12-18 12:31:45 +01:00
commit f1a5f8ab4d

View file

@ -71,7 +71,13 @@ rlJournalStart
echo -e "--_STAP_PID--\n${_STAP_PID}" # info
# wait for systemtap to start
rlWaitForCmd "grep 'starting run' ${_STAP_OUT}"
rlWaitForCmd "grep 'starting run' ${_STAP_OUT}" -p "${_STAP_PID}"
sleep 1
# check systemtap process, because systemtap can fail after logging
# "starting run".
rlRun "ps -q ${_STAP_PID}" 0 \
"Checking systemtap process in background" \
|| rlRun -t "cat ${_STAP_OUT}"
rlRun "$RUBY $RUBY_OPTS -e '1.0 + 9.0'" 0 "Running ruby interpreter: Float test"
rlRun "$RUBY $RUBY_OPTS -e '[1, 2, 3].push(4)'" 0 "Running ruby interpreter: Array test"