]> Sergey Matveev's repositories - public-inbox.git/commitdiff
xt/mem-imapd-tls: avoid EMFILE in -imapd process
authorEric Wong <e@yhbt.net>
Mon, 13 Jul 2020 02:23:28 +0000 (02:23 +0000)
committerEric Wong <e@yhbt.net>
Mon, 13 Jul 2020 21:12:57 +0000 (21:12 +0000)
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

index 660fdc77a2b740b5db8d085561dbaae52e73efd2..3f1436c7da14966135c4a7177331343ff42f9f5c 100644 (file)
@@ -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 = (