From c9d526d84da88554b54e903481898c77e47cf7f1 Mon Sep 17 00:00:00 2001 From: Artem Boldariev Date: Fri, 27 Oct 2023 01:43:00 +0300 Subject: [PATCH] Increase conn. timeout in the timeout recovery tests Due to increased number of the NM unit tests and, thus, increased load on the system timeout recovery tests can sometimes fail, in particular on FreeBSD. This commit fixes that. Besides, it seems that use of T_SOFT here was unintentional to begin with. --- tests/isc/doh_test.c | 10 +++++----- tests/isc/netmgr_common.c | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/isc/doh_test.c b/tests/isc/doh_test.c index eb393d5412..ad083f1e70 100644 --- a/tests/isc/doh_test.c +++ b/tests/isc/doh_test.c @@ -109,7 +109,8 @@ static atomic_bool use_PROXY_over_TLS = false; static isc_nm_t **nm = NULL; /* Timeout for soft-timeout tests (0.05 seconds) */ -#define T_SOFT 50 +#define T_SOFT 50 +#define T_CONNECT 30 * 1000 #define NSENDS 100 #define NWRITES 10 @@ -697,7 +698,8 @@ doh_timeout_recovery(void *arg ISC_ATTR_UNUSED) { ISC_NM_HTTP_DEFAULT_PATH); isc_nm_httpconnect(connect_nm, NULL, &tcp_listen_addr, req_url, atomic_load(&POST), timeout_request_cb, NULL, ctx, - client_sess_cache, T_SOFT, get_proxy_type(), NULL); + client_sess_cache, T_CONNECT, get_proxy_type(), + NULL); } static int @@ -771,7 +773,7 @@ doh_connect_thread(void *arg) { */ int_fast64_t active = atomic_fetch_add(&active_cconnects, 1); if (active > workers) { - goto next; + return; } connect_send_request(connect_nm, req_url, atomic_load(&POST), &(isc_region_t){ .base = (uint8_t *)send_msg.base, @@ -782,8 +784,6 @@ doh_connect_thread(void *arg) { if (sends <= 0) { isc_loopmgr_shutdown(loopmgr); } - -next: {} } static void diff --git a/tests/isc/netmgr_common.c b/tests/isc/netmgr_common.c index e5d685f4fe..e11d7f8330 100644 --- a/tests/isc/netmgr_common.c +++ b/tests/isc/netmgr_common.c @@ -978,7 +978,7 @@ stream_timeout_recovery(void **state ISC_ATTR_UNUSED) { */ isc_nm_settimeouts(connect_nm, T_SOFT, T_SOFT, T_SOFT, T_SOFT); connect_readcb = timeout_retry_cb; - stream_connect(connect_connect_cb, NULL, T_SOFT); + stream_connect(connect_connect_cb, NULL, T_CONNECT); } int