Patrick Williams | 864cc43 | 2023-02-09 14:54:44 -0600 | [diff] [blame^] | 1 | From 225abf37cd0b49960664b59f08e515a4c4ea5ad0 Mon Sep 17 00:00:00 2001 |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 2 | From: Jeremy Puhlman <jpuhlman@mvista.com> |
| 3 | Date: Thu, 26 Mar 2020 18:30:36 +0000 |
| 4 | Subject: [PATCH] Add option to disable timed dependant tests |
| 5 | |
Patrick Williams | 864cc43 | 2023-02-09 14:54:44 -0600 | [diff] [blame^] | 6 | The disabled tests rely on timing to pass correctly. On a virtualized |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 7 | system under heavy load, these tests randomly fail because they miss |
| 8 | a timer or other timing related issues. |
| 9 | |
| 10 | Upstream-Status: Pending |
| 11 | Signed-off-by: Jeremy Puhlman <jpuhlman@mvista.com> |
Patrick Williams | 864cc43 | 2023-02-09 14:54:44 -0600 | [diff] [blame^] | 12 | |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 13 | --- |
| 14 | configure.in | 6 ++++++ |
| 15 | include/apr.h.in | 1 + |
| 16 | test/testlock.c | 4 ++-- |
| 17 | 3 files changed, 9 insertions(+), 2 deletions(-) |
| 18 | |
| 19 | diff --git a/configure.in b/configure.in |
Patrick Williams | 864cc43 | 2023-02-09 14:54:44 -0600 | [diff] [blame^] | 20 | index bfd488b..3663220 100644 |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 21 | --- a/configure.in |
| 22 | +++ b/configure.in |
Patrick Williams | 864cc43 | 2023-02-09 14:54:44 -0600 | [diff] [blame^] | 23 | @@ -3023,6 +3023,12 @@ AC_ARG_ENABLE(timedlocks, |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 24 | ) |
| 25 | AC_SUBST(apr_has_timedlocks) |
| 26 | |
| 27 | +AC_ARG_ENABLE(timed-tests, |
| 28 | + [ --disable-timed-tests Disable timed tests ], |
| 29 | + [apr_has_timedtests="0"], [apr_has_timedtests="1"] |
| 30 | +) |
| 31 | +AC_SUBST(apr_has_timedtests) |
| 32 | + |
| 33 | # hstrerror is only needed if IPv6 is not enabled, |
| 34 | # so getaddrinfo/gai_strerror are not used. |
| 35 | if test $have_ipv6 = 0; then |
| 36 | diff --git a/include/apr.h.in b/include/apr.h.in |
| 37 | index ee99def..c46a5f4 100644 |
| 38 | --- a/include/apr.h.in |
| 39 | +++ b/include/apr.h.in |
| 40 | @@ -298,6 +298,7 @@ extern "C" { |
| 41 | #define APR_HAS_XTHREAD_FILES @apr_has_xthread_files@ |
| 42 | #define APR_HAS_OS_UUID @osuuid@ |
| 43 | #define APR_HAS_TIMEDLOCKS @apr_has_timedlocks@ |
| 44 | +#define APR_HAVE_TIME_DEPENDANT_TESTS @apr_has_timedtests@ |
| 45 | |
| 46 | #define APR_PROCATTR_USER_SET_REQUIRES_PASSWORD @apr_procattr_user_set_requires_password@ |
| 47 | |
| 48 | diff --git a/test/testlock.c b/test/testlock.c |
Patrick Williams | 864cc43 | 2023-02-09 14:54:44 -0600 | [diff] [blame^] | 49 | index e3437c1..04e01b9 100644 |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 50 | --- a/test/testlock.c |
| 51 | +++ b/test/testlock.c |
Patrick Williams | 864cc43 | 2023-02-09 14:54:44 -0600 | [diff] [blame^] | 52 | @@ -535,7 +535,7 @@ abts_suite *testlock(abts_suite *suite) |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 53 | abts_run_test(suite, threads_not_impl, NULL); |
| 54 | #else |
| 55 | abts_run_test(suite, test_thread_mutex, NULL); |
| 56 | -#if APR_HAS_TIMEDLOCKS |
| 57 | +#if APR_HAS_TIMEDLOCKS && APR_HAVE_TIME_DEPENDANT_TESTS |
| 58 | abts_run_test(suite, test_thread_timedmutex, NULL); |
| 59 | #endif |
Patrick Williams | 864cc43 | 2023-02-09 14:54:44 -0600 | [diff] [blame^] | 60 | abts_run_test(suite, test_thread_nestedmutex, NULL); |
| 61 | @@ -543,7 +543,7 @@ abts_suite *testlock(abts_suite *suite) |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 62 | abts_run_test(suite, test_thread_rwlock, NULL); |
| 63 | abts_run_test(suite, test_cond, NULL); |
| 64 | abts_run_test(suite, test_timeoutcond, NULL); |
| 65 | -#if APR_HAS_TIMEDLOCKS |
| 66 | +#if APR_HAS_TIMEDLOCKS && APR_HAVE_TIME_DEPENDANT_TESTS |
| 67 | abts_run_test(suite, test_timeoutmutex, NULL); |
| 68 | #endif |
Patrick Williams | 864cc43 | 2023-02-09 14:54:44 -0600 | [diff] [blame^] | 69 | #ifdef WIN32 |