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.
This commit is contained in:
Artem Boldariev
2024-03-28 16:22:11 +02:00
parent 381273f89f
commit 7f805659c3

View File

@@ -38,17 +38,20 @@
#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);