From 001b78cd43bf78c93f15582949eb557cc3ca6f43 Mon Sep 17 00:00:00 2001 From: Artem Boldariev Date: Wed, 12 Oct 2022 19:44:00 +0300 Subject: [PATCH] doh_test: change slowdown logic so that it will not stuck There is a slight chance that active_cconnects could exceed the number of workers, making the unit test stuck. --- tests/isc/doh_test.c | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/isc/doh_test.c b/tests/isc/doh_test.c index fca204c307..86bd76c589 100644 --- a/tests/isc/doh_test.c +++ b/tests/isc/doh_test.c @@ -725,6 +725,7 @@ doh_connect_thread(void *arg) { */ int_fast64_t active = atomic_fetch_add(&active_cconnects, 1); if (active > workers) { + (void)atomic_fetch_sub(&active_cconnects, 1); goto next; } connect_send_request(connect_nm, req_url, atomic_load(&POST),