]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
dispatch_test: use the NM tests timeouts
authorArtem Boldariev <artem@boldariev.com>
Thu, 28 Mar 2024 14:22:11 +0000 (16:22 +0200)
committerArtem Boldariev <artem@boldariev.com>
Mon, 15 Apr 2024 13:33:24 +0000 (16:33 +0300)
This commit makes the dispatch_test use the same timeouts that network
manager tests. We do that because the old values appear to be too
small for our heavy loaded CI machines, leading to spurious failures
on them. The network manager tests are much more stable in this
situation and they use somewhat larger timeout values.

We use a smaller connection timeouts for the tests which are expected
to timeout to not wait for too long.

tests/dns/dispatch_test.c

index 2516b0b2b0e2bbccc3b8f1880bfbd57d3c40276a..8352ca0913289ca797ec86972a6cc08133975e26 100644 (file)
 #include <tests/dns.h>
 
 /* Timeouts in miliseconds */
-#define T_SERVER_INIT      10000
-#define T_SERVER_IDLE      10000
-#define T_SERVER_KEEPALIVE  10000
-#define T_SERVER_ADVERTISED 10000
+#define T_SERVER_INIT      (120 * 1000)
+#define T_SERVER_IDLE      (120 * 1000)
+#define T_SERVER_KEEPALIVE  (120 * 1000)
+#define T_SERVER_ADVERTISED (120 * 1000)
 
-#define T_CLIENT_INIT      10000
-#define T_CLIENT_IDLE      10000
-#define T_CLIENT_KEEPALIVE  10000
-#define T_CLIENT_ADVERTISED 10000
+#define T_CLIENT_INIT      (120 * 1000)
+#define T_CLIENT_IDLE      (120 * 1000)
+#define T_CLIENT_KEEPALIVE  (120 * 1000)
+#define T_CLIENT_ADVERTISED (120 * 1000)
 
-#define T_CLIENT_CONNECT 10000
+#define T_CLIENT_CONNECT (30 * 1000)
+
+/* For checks which are expected to timeout */
+#define T_CLIENT_CONNECT_SHORT (10 * 1000)
 
 /* dns_dispatchset_t *dset = NULL; */
 static isc_sockaddr_t udp_server_addr;
@@ -578,10 +581,10 @@ ISC_LOOP_TEST_IMPL(dispatch_timeout_tcp_connect) {
        assert_int_equal(result, ISC_R_SUCCESS);
 
        result = dns_dispatch_add(test->dispatch, isc_loop_main(loopmgr), 0,
-                                 T_CLIENT_CONNECT, &tcp_server_addr, NULL,
-                                 NULL, timeout_connected, client_senddone,
-                                 response_timeout, test, &test->id,
-                                 &test->dispentry);
+                                 T_CLIENT_CONNECT_SHORT, &tcp_server_addr,
+                                 NULL, NULL, timeout_connected,
+                                 client_senddone, response_timeout, test,
+                                 &test->id, &test->dispentry);
        assert_int_equal(result, ISC_R_SUCCESS);
 
        testdata.message[0] = (test->id >> 8) & 0xff;
@@ -622,10 +625,11 @@ ISC_LOOP_TEST_IMPL(dispatch_timeout_tcp_response) {
                                        &tcp_server_addr, 0, &test->dispatch);
        assert_int_equal(result, ISC_R_SUCCESS);
 
-       result = dns_dispatch_add(
-               test->dispatch, isc_loop_main(loopmgr), 0, T_CLIENT_CONNECT,
-               &tcp_server_addr, NULL, NULL, connected, client_senddone,
-               response_timeout, test, &test->id, &test->dispentry);
+       result = dns_dispatch_add(test->dispatch, isc_loop_main(loopmgr), 0,
+                                 T_CLIENT_CONNECT_SHORT, &tcp_server_addr,
+                                 NULL, NULL, connected, client_senddone,
+                                 response_timeout, test, &test->id,
+                                 &test->dispentry);
        assert_int_equal(result, ISC_R_SUCCESS);
 
        dns_dispatch_connect(test->dispentry);
@@ -729,10 +733,11 @@ ISC_LOOP_TEST_IMPL(dispatch_timeout_udp_response) {
                                        &test->dispatch);
        assert_int_equal(result, ISC_R_SUCCESS);
 
-       result = dns_dispatch_add(
-               test->dispatch, isc_loop_main(loopmgr), 0, T_CLIENT_CONNECT,
-               &udp_server_addr, NULL, NULL, connected, client_senddone,
-               response_timeout, test, &test->id, &test->dispentry);
+       result = dns_dispatch_add(test->dispatch, isc_loop_main(loopmgr), 0,
+                                 T_CLIENT_CONNECT_SHORT, &udp_server_addr,
+                                 NULL, NULL, connected, client_senddone,
+                                 response_timeout, test, &test->id,
+                                 &test->dispentry);
        assert_int_equal(result, ISC_R_SUCCESS);
 
        dns_dispatch_connect(test->dispentry);