]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
imap/test-imap-client-hibernate: Propagate failures in imap_hibernate_server()
authorKarl Fleischmann <karl.fleischmann@open-xchange.com>
Wed, 9 Apr 2025 10:48:35 +0000 (12:48 +0200)
committeraki.tuomi <aki.tuomi@open-xchange.com>
Thu, 10 Apr 2025 06:09:38 +0000 (06:09 +0000)
The subprocess needs to propagate the error to the diligent parent process.

src/imap/test-imap-client-hibernate.c

index 9f9eacaa58538f5e8e91d10ebac97760412815ea..0e352142ccf828e9f3f6c5d11af92381215c7d6f 100644 (file)
@@ -20,6 +20,7 @@
 #include <sys/stat.h>
 
 #define TEMP_DIRNAME ".test-ich"
+#define SERVER_KILL_TIMEOUT_SECS 10
 
 #define EVILSTR "\t\r\n\001"
 
@@ -128,7 +129,7 @@ static int imap_hibernate_server(struct test_imap_client_hibernate *ctx)
 
        mail_storage_service_deinit(&storage_service);
        master_service_deinit_forked(&master_service);
-       return 0;
+       return test_has_failed() ? 1 : 0;
 }
 
 static void
@@ -236,6 +237,8 @@ static void test_imap_client_hibernate(void)
           deinitializing cleanly */
        mailbox_notify_changes(client->mailbox, mailbox_notify_callback, client);
        test_assert(imap_client_hibernate(&client, &error));
+       test_subprocess_kill_all(SERVER_KILL_TIMEOUT_SECS);
+
        test_end();
 
        i_close_fd(&ctx.fd_listen);