Skip to content

Commit 90950a4

Browse files
jpuhlmankanavin
authored andcommitted
Add option to disable timed dependant tests
The disabled tests rely on timing to pass correctly. On a virtualized system under heavy load, these tests randomly fail because they miss a timer or other timing related issues. Signed-off-by: Jeremy Puhlman <[email protected]>
1 parent 5d037c6 commit 90950a4

File tree

3 files changed

+14
-1
lines changed

3 files changed

+14
-1
lines changed

configure.in

+8
Original file line numberDiff line numberDiff line change
@@ -3121,6 +3121,14 @@ AC_MSG_RESULT($ipv6_result)
31213121

31223122
AC_SUBST(have_ipv6)
31233123

3124+
AC_ARG_ENABLE(timed-tests,
3125+
[ --disable-timed-tests Disable timed tests ],
3126+
[apr_has_timed_tests=$enableval], [apr_has_timed_tests=yes]
3127+
)
3128+
AS_IF([test "x$apr_has_timed_tests" != xno],
3129+
[AC_DEFINE([APR_HAVE_TIME_DEPENDANT_TESTS], [1], [Whether timed tests should be enabled.])]
3130+
)
3131+
31243132
# hstrerror is only needed if IPv6 is not enabled,
31253133
# so getaddrinfo/gai_strerror are not used.
31263134
if test $have_ipv6 = 0; then

test/Makefile.in

+1-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ CLEAN_TARGETS = testfile.tmp lfstests/*.bin \
7474
CLEAN_SUBDIRS = internal
7575

7676
INCDIR=../include
77-
INCLUDES=-I$(INCDIR) -I$(srcdir)/../include
77+
INCLUDES=-I$(INCDIR) -I$(srcdir)/../include -I$(srcdir)/../include/arch/@DEFAULT_OSDIR@
7878

7979
# link programs using -no-install to get real executables not
8080
# libtool wrapper scripts which link an executable when first run.

test/testlock.c

+5
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
#include "apr_general.h"
2424
#include "apr_getopt.h"
2525
#include "apr_atomic.h"
26+
#include "apr_private.h"
2627
#include "testutil.h"
2728

2829
#if APR_HAS_THREADS
@@ -551,13 +552,17 @@ abts_suite *testlock(abts_suite *suite)
551552
abts_run_test(suite, threads_not_impl, NULL);
552553
#else
553554
abts_run_test(suite, test_thread_mutex, NULL);
555+
#if APR_HAVE_TIME_DEPENDANT_TESTS
554556
abts_run_test(suite, test_thread_timedmutex, NULL);
557+
#endif
555558
abts_run_test(suite, test_thread_nestedmutex, NULL);
556559
abts_run_test(suite, test_thread_unnestedmutex, NULL);
557560
abts_run_test(suite, test_thread_rwlock, NULL);
558561
abts_run_test(suite, test_cond, NULL);
559562
abts_run_test(suite, test_timeoutcond, NULL);
563+
#if APR_HAVE_TIME_DEPENDANT_TESTS
560564
abts_run_test(suite, test_timeoutmutex, NULL);
565+
#endif
561566
#ifdef WIN32
562567
abts_run_test(suite, test_win32_abandoned_mutex, NULL);
563568
#endif

0 commit comments

Comments
 (0)