You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by st...@apache.org on 2014/08/02 23:20:21 UTC
svn commit: r1615369 -
/subversion/trunk/subversion/tests/libsvn_subr/named_atomic-test-common.h
Author: stefan2
Date: Sat Aug 2 21:20:20 2014
New Revision: 1615369
URL: http://svn.apache.org/r1615369
Log:
Try to address the test timeouts on the solaris build bot.
We don't have efficient atomics on these platforms so we fall back
to explict locking. Polling for values to change may prevent the
dependent from actually grabbing the lock and do something useful.
This is simply to get the tests to pass (and potentially identify
locking mistakes). But we won't actually use named atomics on these
platforms in SVN.
* subversion/tests/libsvn_subr/named_atomic-test-common.h
(watchdog_t): Add a flag to indicate the need to throttle polling.
(init_watchdog): Init the new flag as well.
(check_watchdog): Throttle execution when indicated.
(test_pipeline_loop): Skip watchdog and throttling when polling
was not necessary. I.e. let the tokens be
passed on without delay.
Modified:
subversion/trunk/subversion/tests/libsvn_subr/named_atomic-test-common.h
Modified: subversion/trunk/subversion/tests/libsvn_subr/named_atomic-test-common.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/libsvn_subr/named_atomic-test-common.h?rev=1615369&r1=1615368&r2=1615369&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/libsvn_subr/named_atomic-test-common.h (original)
+++ subversion/trunk/subversion/tests/libsvn_subr/named_atomic-test-common.h Sat Aug 2 21:20:20 2014
@@ -48,7 +48,8 @@ typedef struct watchdog_t
apr_time_t deadline;
svn_named_atomic__t *atomic_counter;
int iterations;
- int call_count; /* don't call apr_time_now() too often '*/
+ int call_count; /* don't call apr_time_now() too often '*/
+ svn_boolean_t throttle; /* TRUE -> we are using file locks for sync */
} watchdog_t;
/* init the WATCHDOG data structure for checking ATOMIC_COUNTER to reach
@@ -65,6 +66,7 @@ init_watchdog(watchdog_t *watchdog,
watchdog->atomic_counter = atomic_counter;
watchdog->iterations = iterations;
watchdog->call_count = 0;
+ watchdog->throttle = !svn_named_atomic__is_efficient();
}
/* test for watchdog conditions */
@@ -84,6 +86,12 @@ check_watchdog(watchdog_t *watchdog, svn
return SVN_NO_ERROR;
}
+ /* If we are using file locks for synchronization, our polling loops will
+ * simply hammering them instead of giving the system time to actually
+ * do something. So, slow down to get faster ... */
+ if (watchdog->throttle)
+ apr_sleep(1000);
+
/* Check the system time and indicate when deadline has passed */
if (++watchdog->call_count > 100)
{