[DTrace-devel] [PATCH 3/6] runtest: pass timeouts down to tests: use it in one test

Nick Alcock nick.alcock at oracle.com
Wed Mar 2 13:44:33 UTC 2022


A few tests implement their own timeouts to let them see whether dtrace
has started up properly.  This is less than ideal when valgrind is in
use, since that routinely causes startup to slow down by an order of
magnitude.  The runtest script adapts the script-wide timeout, but
this is not passed down to tests so they cannot do the same even if
they wanted to.

So pass down $timeout, and adjust one test that spuriously fails.

Signed-off-by: Nick Alcock <nick.alcock at oracle.com>
---
 runtest.sh                                    | 2 +-
 test/unittest/providers/tst.dtrace_cleanup.sh | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/runtest.sh b/runtest.sh
index 72484dfae182..62f2ce38fe84 100755
--- a/runtest.sh
+++ b/runtest.sh
@@ -750,7 +750,7 @@ for dt in $dtrace; do
         base=${base%.sh}
         base=${base%.c}
         testonly="$(basename $_test)"
-        timeout="$TIMEOUT"
+        export timeout="$TIMEOUT"
 
         # Hidden files and editor backup files are not tests.
 
diff --git a/test/unittest/providers/tst.dtrace_cleanup.sh b/test/unittest/providers/tst.dtrace_cleanup.sh
index 98e1885d3111..eb731188adfd 100755
--- a/test/unittest/providers/tst.dtrace_cleanup.sh
+++ b/test/unittest/providers/tst.dtrace_cleanup.sh
@@ -20,7 +20,7 @@ out=/tmp/output.$$
 $dtrace $dt_flags -n BEGIN,END &>> $out &
 pid=$!
 
-for iter in 1 2 3 4 5 6; do
+for iter in $(seq 1 $((timeout/2))); do
     sleep 1
     if grep -q :BEGIN $out; then
         iter=0
-- 
2.35.0.260.gb82b153193.dirty




More information about the DTrace-devel mailing list