automake-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug#60807] [PATCH v2] tests: reuse am_cv_filesystem_timestamp_resolutio


From: Jim Meyering
Subject: [bug#60807] [PATCH v2] tests: reuse am_cv_filesystem_timestamp_resolution
Date: Fri, 3 Feb 2023 23:02:59 -0800

On Sat, Jan 14, 2023 at 4:19 PM Mike Frysinger <vapier@gentoo.org> wrote:
> Rather than assume such coarse delays, re-use existing logic for
> probing the current filesystem resolution.  This speeds up the
> testsuite significantly.  On my system, it speeds -j1 up quite a
> lot -- by ~30%.  While I didn't gather many samples to produce a
> statistically significant distribution, my runs seem to be fairly
> consistent with the values below with deviations of <1 minute.
>
> $ time make -j1
>     Before                After
> real  33m17.182s      real  23m33.557s
> user  12m12.145s      user  12m12.763s
> sys   1m52.308s       sys   1m52.853s
>
> $ time make -j32
>     Before                After
> real  1m35.874s       real  1m4.908s
> user  14m24.664s      user  15m58.663s
> sys   2m9.297s        sys   2m27.393s
>
> * configure.ac: Set test delays to am_cv_filesystem_timestamp_resolution.
> * t/aclocal-no-force.sh: Use slower sleep if subsecond APIs are missing.
> * t/ax/test-defs.in: Split sleep settings into separate variables.
> ---
>  configure.ac          | 10 +---------
>  t/aclocal-no-force.sh | 12 ++++++++++++
>  t/ax/test-defs.in     |  5 ++---
>  3 files changed, 15 insertions(+), 12 deletions(-)
>
> diff --git a/configure.ac b/configure.ac
> index dcf2d95566a0..d3a67d5ffec9 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -172,15 +172,7 @@ result=no
>  test "x$am_cv_prog_ln" = xln && result=yes
>  AC_MSG_RESULT([$result])
>
> -# The amount we should wait after modifying files depends on the platform.
> -# On Windows '95, '98 and ME, files modifications have 2-seconds
> -# granularity and can be up to 3 seconds in the future w.r.t. the
> -# system clock.  When it is important to ensure one file is older
> -# than another we wait at least 5 seconds between creations.
> -case $build in
> -  *-pc-msdosdjgpp) MODIFICATION_DELAY=5;;
> -  *)               MODIFICATION_DELAY=2;;
> -esac
> +MODIFICATION_DELAY=$am_cv_filesystem_timestamp_resolution
>  AC_SUBST([MODIFICATION_DELAY])
>
>  ## ------------------------------------------- ##
> diff --git a/t/aclocal-no-force.sh b/t/aclocal-no-force.sh
> index 3e0c04d12f18..2e139d75cf74 100644
> --- a/t/aclocal-no-force.sh
> +++ b/t/aclocal-no-force.sh
> @@ -19,6 +19,18 @@
>
>  . test-init.sh
>
> +# Automake relies on high resolution timestamps in perl.  If support isn't
> +# available (see lib/Automake/FileUtils.pm), then fallback to coarse sleeps.
> +# The creative quoting is to avoid spuriously triggering a failure in
> +# the maintainer checks.
> +case ${sleep_delay} in
> +0*)
> +  if ! $PERL -e 'use Time::HiRes' 2>/dev/null; then
> +    sleep='sleep ''2'
> +  fi
> +  ;;

Thanks, Mike. Thanks for this.
Do you feel like adjusting this in light of Paul's
recent change to require a version of Perl new enough to
always provide Time::HiRes support?

https://git.savannah.gnu.org/cgit/automake.git/commit/?id=01bf65daf6f6627b56fbe78fc436fd877ccd3537





reply via email to

[Prev in Thread] Current Thread [Next in Thread]