[DTrace-devel] [PATCH] test: Allow walltimestamp not to progress on successive calls

Kris Van Hees kris.van.hees at oracle.com
Fri Apr 22 06:56:41 UTC 2022


On Thu, Apr 21, 2022 at 09:56:04PM -0400, eugene.loh--- via DTrace-devel wrote:
> From: Eugene Loh <eugene.loh at oracle.com>
> 
> Signed-off-by: Eugene Loh <eugene.loh at oracle.com>

Reviewed-by: Kris Van Hees <kris.van.hees at oracle.com>

... and added to dev (with change of copyright statement to include 2022)

> ---
>  .../unittest/variables/bvar/tst.walltimestamp2.r.p | 14 +++++++++-----
>  1 file changed, 9 insertions(+), 5 deletions(-)
> 
> diff --git a/test/unittest/variables/bvar/tst.walltimestamp2.r.p b/test/unittest/variables/bvar/tst.walltimestamp2.r.p
> index 48652ded..e72a033d 100755
> --- a/test/unittest/variables/bvar/tst.walltimestamp2.r.p
> +++ b/test/unittest/variables/bvar/tst.walltimestamp2.r.p
> @@ -18,11 +18,15 @@
>          d4 = $1; getline;
>          d5 = $1;
>  
> -        # check that the deltas are all positive
> -        if (d2 <= 0 ||
> -            d3 <= 0 ||
> -            d4 <= 0 ||
> -            d5 <= 0) print "ERROR: walltimestamp did not advance.";
> +        # check that no delta is negative
> +        if (d2 < 0 ||
> +            d3 < 0 ||
> +            d4 < 0 ||
> +            d5 < 0) print "ERROR: walltimestamp went backwards.";
> +
> +        # check walltimestamp advanced
> +        if (d2 + d3 + d4 + d5 <= 0)
> +            print "ERROR: walltimestamp did not advance.";
>  
>          # check that the deltas are all under 0.2 seconds
>          if (d2 > 200000000 ||
> -- 
> 2.18.4
> 
> 
> _______________________________________________
> 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