[DTrace-devel] [PATCH 3/6] runtest: pass timeouts down to tests: use it in one test
Eugene Loh
eugene.loh at oracle.com
Fri Mar 4 20:40:07 UTC 2022
Reviewed-by: Eugene Loh <eugene.loh at oracle.com>
Incidentally, do the files need updated copyright years?
Also, it'd be nice if there were some name-space prefix for variables
exported by runtest.sh, but perhaps that is beyond the scope of this patch.
On 3/2/22 8:44 AM, Nick Alcock via DTrace-devel wrote:
> 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
More information about the DTrace-devel
mailing list