]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Fix the doh_recv_send() logic in the doh_test
authorArtem Boldariev <artem@boldariev.com>
Thu, 5 Aug 2021 09:42:40 +0000 (12:42 +0300)
committerArtem Boldariev <artem@boldariev.com>
Thu, 12 Aug 2021 11:28:17 +0000 (14:28 +0300)
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.

lib/isc/tests/doh_test.c

index e4f59ce7fdf8f375ce343ec582c86c7c3caae885..4f5c464e0a49d6bc867918c8837fd27a484e1911 100644 (file)
@@ -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);
        }