[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: [RFC] Stop sleeping for timestamps when running tests

From: Ivan Zhakov <chemodax_at_gmail.com>
Date: 2007-03-12 09:55:51 CET

Hi Erik,

I've no thoughts about idea itself, but I've several comments about
implementation.
- According documentation getenv() returns NULL if environment variable didn't
  set. You don't check this.
- I propose to make semantic of variable similar as SVN_ASP_DOT_NET_HACK.
  I.e. make variable SVN_NO_SLEEP_FOR_TIMESTAMPS and doesn't care
  about it's contents.

On 3/11/07, Erik Huelsmann <ehuels@gmail.com> wrote:
> In the last few days, I committed an extra criterion to help determine
> 'changedness' of a file: libsvn_wc also considers the size of the file
> at hand. So, now we do not only depend on the timestamp any more. If a
> file changes in size (but not in time), svn will detect it's possibly
> changed.
>
> In our test-suite all but 2 tests change the sizes of the files
> involved in the test. That means that all (except these 2) tests don't
> have to depend on the timestamp to complete successfully.
>
> I added (locally) a test to svn_sleep_for_timestamps() to check an
> environment variable whether or not to sleep for stamps. When running
> the test suite with that variable set to the right value,
> basic_tests.py took 24seconds.
>
> Recently lgo added parellel (?) execution of tests. Tests run in
> parellel also take 24seconds.
>
> I'd like to change our test suite to not sleep for timestamps except
> for a specified number of tests. Currently the specified tests would
> be the ones which fail without sleeping. That way, we won't need the
> parellelized feature (lgo prefers to rip that).
>
> Additional benefit of not-sleeping versus parellelizing is that the
> on-disk space-requirements stay the same as they currently are. This
> could be important for execution on RAM disks.
>
>
> Comments?
>
>
> bye,
>
> Erik
>
> The patch to libsvn_subr:svn_sleep_for_timestamps():
>
> Index: subversion/libsvn_subr/time.c
> ===================================================================
> --- subversion/libsvn_subr/time.c (revision 23768)
> +++ subversion/libsvn_subr/time.c (working copy)
> @@ -2,7 +2,7 @@
> * time.c: time/date utilities
> *
> * ====================================================================
> - * Copyright (c) 2000-2004 CollabNet. All rights reserved.
> + * Copyright (c) 2000-2007 CollabNet. All rights reserved.
> *
> * This software is licensed as described in the file COPYING, which
> * you should have received as part of this distribution. The terms
> @@ -289,9 +289,13 @@
> svn_sleep_for_timestamps(void)
> {
> apr_time_t now, then;
> + const char *env_val = getenv("SVN_SLEEP_FOR_TIMESTAMPS");
>
> /* Sleep until the next second tick, plus a tenth of a second for margin. */
> - now = apr_time_now();
> - then = apr_time_make(apr_time_sec(now) + 1, APR_USEC_PER_SEC / 10);
> - apr_sleep(then - now);
> + if (apr_strnatcasecmp(env_val, "no") != 0)
> + {
> + now = apr_time_now();
> + then = apr_time_make(apr_time_sec(now) + 1, APR_USEC_PER_SEC / 10);
> + apr_sleep(then - now);
> + }
> }
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
> For additional commands, e-mail: dev-help@subversion.tigris.org
>
>

-- 
Ivan Zhakov
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Mon Mar 12 09:56:07 2007

This is an archived mail posted to the Subversion Dev mailing list.