[DTrace-devel] [PATCH v2] test: Disown child pid for cleaner stderr
eugene.loh at oracle.com
eugene.loh at oracle.com
Thu Oct 31 04:49:06 UTC 2024
From: Eugene Loh <eugene.loh at oracle.com>
The shell can report when a job is killed, potentially
polluting stderr and thereby mismatching the results file.
When a job is killed at the end of test, appearance of such
reports may depend on timing details: does the parent test
or the child job terminate first?
Many tests deal with this problem by disowning child jobs.
Disown jobs in a few more possibly problematic tests.
Signed-off-by: Eugene Loh <eugene.loh at oracle.com>
---
test/unittest/usdt/tst.dlclose1.sh | 1 +
test/unittest/usdt/tst.enable_pid.sh | 2 ++
test/unittest/usdt/tst.exec-dof-replacement.sh | 1 +
test/unittest/usdt/tst.nusdtprobes.sh | 1 +
4 files changed, 5 insertions(+)
diff --git a/test/unittest/usdt/tst.dlclose1.sh b/test/unittest/usdt/tst.dlclose1.sh
index ee4d95f3b..b65e4de5d 100755
--- a/test/unittest/usdt/tst.dlclose1.sh
+++ b/test/unittest/usdt/tst.dlclose1.sh
@@ -200,6 +200,7 @@ function mywait() {
./main > myfile.txt &
pid=$!
+disown %+
echo started pid $pid
mywait 6 "started" myfile.txt # wait for process to start
diff --git a/test/unittest/usdt/tst.enable_pid.sh b/test/unittest/usdt/tst.enable_pid.sh
index 91923014d..bbb7680c4 100755
--- a/test/unittest/usdt/tst.enable_pid.sh
+++ b/test/unittest/usdt/tst.enable_pid.sh
@@ -142,8 +142,10 @@ fi
./main >& out.1 &
pid1=$!
+disown %+
./main >& out.2 &
pid2=$!
+disown %+
#
# Run DTrace with different pid probes, each case is its own "epoch":
diff --git a/test/unittest/usdt/tst.exec-dof-replacement.sh b/test/unittest/usdt/tst.exec-dof-replacement.sh
index 9f30bbfcc..f9cf6bdb2 100755
--- a/test/unittest/usdt/tst.exec-dof-replacement.sh
+++ b/test/unittest/usdt/tst.exec-dof-replacement.sh
@@ -81,6 +81,7 @@ fi
./test1 &
PROC=$!
+disown %+
# Wait for the exec, then list all the target's probes.
# We cannot use pure dtrace to do this because it doesn't check
diff --git a/test/unittest/usdt/tst.nusdtprobes.sh b/test/unittest/usdt/tst.nusdtprobes.sh
index 50f18a6ca..4b5050ff9 100755
--- a/test/unittest/usdt/tst.nusdtprobes.sh
+++ b/test/unittest/usdt/tst.nusdtprobes.sh
@@ -121,6 +121,7 @@ for nusdt in "" "-xnusdtprobes=40" "-xnusdtprobes=39"; do
for (( immbr = 0; immbr < $nmmbrs; immbr++ )); do
./main &
pids[$immbr]=$!
+ disown %+
for j in `seq 0 9`; do
echo testprov${pids[$immbr]} main main foo$j >> check.txt
done
--
2.43.5
More information about the DTrace-devel
mailing list