From 3f24bd2bce5134a5eaac4136e1d363c567c46a94 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ond=C5=99ej=20Sur=C3=BD?= <ondrej@isc.org>
Date: Thu, 10 Feb 2022 08:42:22 +0100
Subject: [PATCH] Update writetimeout to be T_IDLE in netmgr_test.c

Use the isc_nmhandle_setwritetimeout() function in the netmgr unit test
to allow more time for writing and reading the responses because some of
the intervals that are used in the unit tests are really small leaving a
little room for any delays.

(cherry picked from commit ee359d6ffa701e5f9781ec75622af22736506bdd)
Conflict: NA
Reference: https://gitlab.isc.org/isc-projects/bind9/-/commit/3f24bd2bce5134a5eaac4136e1d363c567c46a94
---
 lib/isc/tests/netmgr_test.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/lib/isc/tests/netmgr_test.c b/lib/isc/tests/netmgr_test.c
index 41113ab7c8..50890e0ab5 100644
--- a/lib/isc/tests/netmgr_test.c
+++ b/lib/isc/tests/netmgr_test.c
@@ -418,6 +418,7 @@ connect_send(isc_nmhandle_t *handle) {
 	isc_nmhandle_t *sendhandle = NULL;
 	isc_refcount_increment0(&active_csends);
 	isc_nmhandle_attach(handle, &sendhandle);
+	isc_nmhandle_setwritetimeout(handle, T_IDLE);
 	if (atomic_fetch_sub(&nsends, 1) > 1) {
 		isc_nm_send(sendhandle, (isc_region_t *)&send_msg,
 			    connect_send_cb, NULL);
@@ -529,6 +530,7 @@ listen_read_cb(isc_nmhandle_t *handle, isc_result_t eresult,
 			isc_nmhandle_t *sendhandle = NULL;
 			isc_nmhandle_attach(handle, &sendhandle);
 			isc_refcount_increment0(&active_ssends);
+			isc_nmhandle_setwritetimeout(sendhandle, T_IDLE);
 			isc_nm_send(sendhandle, (isc_region_t *)&send_msg,
 				    listen_send_cb, cbarg);
 		}
-- 
2.23.0

