]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Increase conn. timeout in the timeout recovery tests
authorArtem Boldariev <artem@boldariev.com>
Thu, 26 Oct 2023 22:43:00 +0000 (01:43 +0300)
committerArtem Boldariev <artem@boldariev.com>
Wed, 6 Dec 2023 13:15:25 +0000 (15:15 +0200)
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
tests/isc/netmgr_common.c

index eb393d5412baa5d41f93df7778f8faf14907b9d3..ad083f1e7009c924ff9148590aaaf5a01a265476 100644 (file)
@@ -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
index e5d685f4fe8d163d8983ad41f8e00667ac4dfd89..e11d7f83300aaf8c0209e73648f2f219226dc8bc 100644 (file)
@@ -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