Skip to content

Commit

Permalink
Add option to disable timed dependant tests
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
jpuhlman authored and Alexander Kanavin committed Feb 28, 2024
1 parent 8986864 commit a3d5e16
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
6 changes: 6 additions & 0 deletions configure.in
Original file line number Diff line number Diff line change
Expand Up @@ -3103,6 +3103,12 @@ AC_MSG_RESULT($ipv6_result)

AC_SUBST(have_ipv6)

AC_ARG_ENABLE(timed-tests,
[ --disable-timed-tests Disable timed tests ],
[apr_has_timedtests="0"], [apr_has_timedtests="1"]
)
AC_SUBST(apr_has_timedtests)

# hstrerror is only needed if IPv6 is not enabled,
# so getaddrinfo/gai_strerror are not used.
if test $have_ipv6 = 0; then
Expand Down
1 change: 1 addition & 0 deletions include/apr.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,7 @@ extern "C" {
#define APR_HAS_LARGE_FILES @aprlfs@
#define APR_HAS_XTHREAD_FILES @apr_has_xthread_files@
#define APR_HAS_OS_UUID @osuuid@
#define APR_HAS_TIME_DEPENDANT_TESTS @apr_has_timedtests@

#define APR_PROCATTR_USER_SET_REQUIRES_PASSWORD @apr_procattr_user_set_requires_password@

Expand Down
4 changes: 4 additions & 0 deletions test/testlock.c
Original file line number Diff line number Diff line change
Expand Up @@ -551,13 +551,17 @@ abts_suite *testlock(abts_suite *suite)
abts_run_test(suite, threads_not_impl, NULL);
#else
abts_run_test(suite, test_thread_mutex, NULL);
#if APR_HAS_TIME_DEPENDANT_TESTS
abts_run_test(suite, test_thread_timedmutex, NULL);
#endif
abts_run_test(suite, test_thread_nestedmutex, NULL);
abts_run_test(suite, test_thread_unnestedmutex, NULL);
abts_run_test(suite, test_thread_rwlock, NULL);
abts_run_test(suite, test_cond, NULL);
abts_run_test(suite, test_timeoutcond, NULL);
#if APR_HAS_TIME_DEPENDANT_TESTS
abts_run_test(suite, test_timeoutmutex, NULL);
#endif
#ifdef WIN32
abts_run_test(suite, test_win32_abandoned_mutex, NULL);
#endif
Expand Down

0 comments on commit a3d5e16

Please sign in to comment.