From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-Status: No, score=-4.0 required=3.0 tests=ALL_TRUSTED,BAYES_00 shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id ADEFA1F5AE for ; Mon, 13 Jul 2020 02:23:28 +0000 (UTC) From: Eric Wong To: meta@public-inbox.org Subject: [PATCH] xt/mem-imapd-tls: avoid EMFILE in -imapd process Date: Mon, 13 Jul 2020 02:23:28 +0000 Message-Id: <20200713022328.22194-1-e@yhbt.net> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: Test::More dups standard FDs and may create FDs for other purposes. run_mode => 0 lets us rely on FD_CLOEXEC to ensure -imapd has enough FDs to accept all incoming connections at the cost of higher (one-off) startup time. --- xt/mem-imapd-tls.t | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/xt/mem-imapd-tls.t b/xt/mem-imapd-tls.t index 660fdc77..3f1436c7 100644 --- a/xt/mem-imapd-tls.t +++ b/xt/mem-imapd-tls.t @@ -49,7 +49,9 @@ my $imaps_addr = $imaps->sockhost . ':' . $imaps->sockport; my $env = { PI_CONFIG => $pi_config }; my $arg = $TEST_TLS ? [ "-limaps://$imaps_addr/?cert=$cert,key=$key" ] : []; my $cmd = [ '-imapd', '-W0', @$arg, "--stdout=$out", "--stderr=$err" ]; -my $td = start_script($cmd, $env, { 3 => $imaps }); + +# run_mode=0 ensures Test::More FDs don't get shared +my $td = start_script($cmd, $env, { 3 => $imaps, run_mode => 0 }); my %ssl_opt; if ($TEST_TLS) { %ssl_opt = (