]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
master: test-auth-client - Avoid using sleep()/usleep().
authorStephan Bosch <stephan.bosch@open-xchange.com>
Fri, 10 Apr 2020 19:53:06 +0000 (21:53 +0200)
committerStephan Bosch <stephan.bosch@open-xchange.com>
Mon, 25 May 2020 17:38:24 +0000 (19:38 +0200)
src/master/test-auth-client.c

index ec778c7dfd5e53ddd9b63d5f1ff559411af54446..41c5105a358ac55efeec81bc0f87d268e19ef7b6 100644 (file)
@@ -12,6 +12,7 @@
 #include "istream-chain.h"
 #include "ostream.h"
 #include "time-util.h"
+#include "sleep.h"
 #include "unlink-directory.h"
 #include "write-full.h"
 #include "connection.h"
@@ -132,7 +133,7 @@ static void test_connection_refused(void)
 
 static void test_connection_timed_out_input(struct server_connection *conn)
 {
-       sleep(5);
+       i_sleep_intr_secs(5);
        server_connection_deinit(&conn);
 }
 
@@ -1211,7 +1212,7 @@ test_run_client_server(test_client_init_t *client_test,
                                i_close_fd(&fd_listen);
                        /* wait for it to be killed; this way, valgrind will not
                           object to this process going away inelegantly. */
-                       sleep(60);
+                       i_sleep_intr_secs(60);
                        exit(1);
                }
                if (fd_listen != -1)
@@ -1225,7 +1226,7 @@ test_run_client_server(test_client_init_t *client_test,
        if (debug)
                i_debug("PID=%s", my_pid);
 
-       usleep(100000); /* wait a little for server setup */
+       i_sleep_intr_msecs(100); /* wait a little for server setup */
 
        ioloop = io_loop_create();
        if (client_test())