From 7f805659c35fa35d5aaf6406812930c904d894a9 Mon Sep 17 00:00:00 2001 From: Artem Boldariev Date: Thu, 28 Mar 2024 16:22:11 +0200 Subject: [PATCH] dispatch_test: use the NM tests timeouts 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 | 47 ++++++++++++++++++++++----------------- 1 file changed, 26 insertions(+), 21 deletions(-) diff --git a/tests/dns/dispatch_test.c b/tests/dns/dispatch_test.c index 2516b0b2b0..8352ca0913 100644 --- a/tests/dns/dispatch_test.c +++ b/tests/dns/dispatch_test.c @@ -38,17 +38,20 @@ #include /* 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);