diff --git a/test/units/testsuite-36.sh b/test/units/testsuite-36.sh index 94fd927a5d..b684011785 100755 --- a/test/units/testsuite-36.sh +++ b/test/units/testsuite-36.sh @@ -34,8 +34,9 @@ journalCursorFile="jounalCursorFile" startStrace() { coproc strace -qq -p 1 -o "$straceLog" -e set_mempolicy -s 1024 ${1:+"$1"} - # Wait for strace to properly "initialize" - sleep $sleepAfterStart + # Wait for strace to properly "initialize", i.e. until PID 1 has the TracerPid + # field set to the current strace's PID + while ! awk -v spid="$COPROC_PID" '/^TracerPid:/ {exit !($2 == spid);}' /proc/1/status; do sleep 0.1; done } stopStrace() {