[DTrace-devel] [PATCH 15/20] runtest: pass timeouts down to tests: use it in one test
Kris Van Hees
kris.van.hees at oracle.com
Wed Jul 27 21:01:54 UTC 2022
On Wed, May 11, 2022 at 10:12:57PM +0100, 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>
Reviewed-by: Kris Van Hees <kris.van.hees at oracle.com>
... and queued for dev
> ---
> 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 41a1335b66b7..387907a8df4a 100755
> --- a/runtest.sh
> +++ b/runtest.sh
> @@ -751,7 +751,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 54f8fd95fbf9..4ac59ccb4315 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 `seq 10`; do
> +for iter in $(seq 1 $((timeout/2))); do
> sleep 1
> if grep -q :BEGIN $out; then
> iter=0
> --
> 2.36.1.263.g194b774378.dirty
>
>
> _______________________________________________
> DTrace-devel mailing list
> DTrace-devel at oss.oracle.com
> https://oss.oracle.com/mailman/listinfo/dtrace-devel
More information about the DTrace-devel
mailing list