]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-http: test-http-client-errors - Fix random hangs
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Thu, 2 Sep 2021 11:31:36 +0000 (14:31 +0300)
committertimo.sirainen <timo.sirainen@open-xchange.com>
Thu, 2 Sep 2021 13:37:11 +0000 (13:37 +0000)
Wait for subprocesses to be initialized before starting each test.
This should fix random hangs with the test.

src/lib-http/test-http-client-errors.c

index 7e6921809d42bc6af2a60d722c76d59a80964a7d..f8efd402e7d66205fe34cbf12a4f73c700e7fbc5 100644 (file)
@@ -3780,6 +3780,7 @@ static int test_run_server(struct test_server_data *data)
        if (debug)
                i_debug("PID=%s", my_pid);
 
+       test_subprocess_notify_signal_send_parent(SIGHUP);
        ioloop = io_loop_create();
        data->server_test(data->index);
        io_loop_destroy(&ioloop);
@@ -3862,6 +3863,8 @@ test_run_client_server(const struct http_client_settings *client_set,
                        fd_listen = fds[i];
                        test_subprocess_fork(test_run_server, &data, FALSE);
                        i_close_fd(&fd_listen);
+                       test_subprocess_notify_signal_wait(SIGHUP, 10000);
+                       test_subprocess_notify_signal_reset(SIGHUP);
                }
        }