From: Marco Bettini Date: Thu, 19 Jan 2023 13:13:04 +0000 (+0000) Subject: global: unit-tests - Extract TEST_SIGNALS_DEFAULT_TIMEOUT_MS constant X-Git-Tag: 2.4.0~3182 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=abca74b9fc6598693ee20fa20b995389cfb12dd1;p=thirdparty%2Fdovecot%2Fcore.git global: unit-tests - Extract TEST_SIGNALS_DEFAULT_TIMEOUT_MS constant --- diff --git a/src/lib-http/test-http-client-errors.c b/src/lib-http/test-http-client-errors.c index ed42326dea..7bb44e23e6 100644 --- a/src/lib-http/test-http-client-errors.c +++ b/src/lib-http/test-http-client-errors.c @@ -424,7 +424,8 @@ test_client_connection_refused(const struct http_client_settings *client_set) struct _connection_refused *ctx; /* wait for the server side to close the socket */ - test_subprocess_notify_signal_wait(SIGUSR1, 10000); + test_subprocess_notify_signal_wait( + SIGUSR1, TEST_SIGNALS_DEFAULT_TIMEOUT_MS); ctx = i_new(struct _connection_refused, 1); ctx->count = 2; @@ -3870,7 +3871,8 @@ test_run_client_server(const struct http_client_settings *client_set, fd_listen = fds[i]; test_subprocess_notify_signal_reset(SIGHUP); test_subprocess_fork(test_run_server, &data, FALSE); - test_subprocess_notify_signal_wait(SIGHUP, 10000); + test_subprocess_notify_signal_wait( + SIGHUP, TEST_SIGNALS_DEFAULT_TIMEOUT_MS); i_close_fd(&fd_listen); } } @@ -3888,7 +3890,8 @@ test_run_client_server(const struct http_client_settings *client_set, fd_listen = fd; test_subprocess_notify_signal_reset(SIGHUP); test_subprocess_fork(test_run_dns, dns_test, FALSE); - test_subprocess_notify_signal_wait(SIGHUP, 10000); + test_subprocess_notify_signal_wait( + SIGHUP, TEST_SIGNALS_DEFAULT_TIMEOUT_MS); i_close_fd(&fd_listen); } diff --git a/src/lib-test/test-subprocess.h b/src/lib-test/test-subprocess.h index 1a8d174db2..598b735299 100644 --- a/src/lib-test/test-subprocess.h +++ b/src/lib-test/test-subprocess.h @@ -1,6 +1,8 @@ #ifndef TEST_SUBPROCESS_H #define TEST_SUBPROCESS_H +#define TEST_SIGNALS_DEFAULT_TIMEOUT_MS 10000 + struct test_subprocess; /* Fork a sub-process for this test. The func is the main function for the