about summary refs log tree commit homepage
path: root/xt
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2023-10-17 23:38:10 +0000
committerEric Wong <e@80x24.org>2023-10-18 20:50:39 +0000
commit70b46c9e778702ee9ca51e25ff79764745a61857 (patch)
tree71fcb11131c5ed08f24a56d4f3f07362bcccfc4e /xt
parentd152464da8e9a71b2a39c6b628627a9433f5706a (diff)
downloadpublic-inbox-70b46c9e778702ee9ca51e25ff79764745a61857.tar.gz
We need some pipes in our parent process to capture the output
of lsof(1), so give us some more padding for temporary FDs.
Diffstat (limited to 'xt')
-rw-r--r--xt/mem-imapd-tls.t10
1 files changed, 6 insertions, 4 deletions
diff --git a/xt/mem-imapd-tls.t b/xt/mem-imapd-tls.t
index bb2f6c35..53adb11b 100644
--- a/xt/mem-imapd-tls.t
+++ b/xt/mem-imapd-tls.t
@@ -6,6 +6,7 @@
 use strict;
 use v5.10.1;
 use Socket qw(SOCK_STREAM IPPROTO_TCP SOL_SOCKET);
+use PublicInbox::Spawn qw(which);
 use PublicInbox::TestCommon;
 use PublicInbox::DS;
 require_mods(qw(-imapd));
@@ -71,7 +72,7 @@ if ($TEST_TLS) {
         $ssl_opt{SSL_startHandshake} = 0;
 }
 chomp(my $nfd = `/bin/sh -c 'ulimit -n'`);
-$nfd -= 10;
+$nfd -= 20;
 ok($nfd > 0, 'positive FD count');
 my $MAX_FD = 10000;
 $nfd = $MAX_FD if $nfd >= $MAX_FD;
@@ -118,10 +119,11 @@ if ($DONE != $nfd) {
         PublicInbox::DS::event_loop();
 }
 is($nfd, $DONE, "$nfd/$DONE done");
-if ($^O eq 'linux' && open(my $f, '<', "/proc/$pid/status")) {
+my $lsof = which('lsof');
+if ($^O eq 'linux' && $lsof && open(my $f, '<', "/proc/$pid/status")) {
         diag(grep(/RssAnon/, <$f>));
-        diag "  SELF lsof | wc -l ".`lsof -p $$ |wc -l`;
-        diag "SERVER lsof | wc -l ".`lsof -p $pid |wc -l`;
+        diag "  SELF lsof | wc -l ".`$lsof -p $$ |wc -l`;
+        diag "SERVER lsof | wc -l ".`$lsof -p $pid |wc -l`;
 }
 PublicInbox::DS->Reset;
 $td->kill;