From: Artem Boldariev Date: Thu, 5 Aug 2021 09:42:40 +0000 (+0300) Subject: Fix the doh_recv_send() logic in the doh_test X-Git-Tag: v9.17.18~40^2~1 X-Git-Url: http://git.ipfire.org/gitweb/?a=commitdiff_plain;h=d72b1fa5cd9bfb12d3d8aa844d6754cc49d92087;p=thirdparty%2Fbind9.git Fix the doh_recv_send() logic in the doh_test The commit fixes the doh_recv_send() because occasionally it would fail because it did not wait for all responses to be sent, making the check for ssends value to nit pass. --- diff --git a/lib/isc/tests/doh_test.c b/lib/isc/tests/doh_test.c index e4f59ce7fdf..4f5c464e0a4 100644 --- a/lib/isc/tests/doh_test.c +++ b/lib/isc/tests/doh_test.c @@ -1075,6 +1075,14 @@ doh_recv_send(void **state) { isc_thread_create(doh_connect_thread, connect_nm, &threads[i]); } + /* wait for the all responses from the server */ + while (atomic_load(&ssends) < atomic_load(&total_sends)) { + if (atomic_load(&was_error)) { + break; + } + isc_test_nap(100); + } + for (size_t i = 0; i < nthreads; i++) { isc_thread_join(threads[i], NULL); }