diff options
author | Eric Wong <e@80x24.org> | 2023-10-17 23:38:10 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2023-10-18 20:50:39 +0000 |
commit | 70b46c9e778702ee9ca51e25ff79764745a61857 (patch) | |
tree | 71fcb11131c5ed08f24a56d4f3f07362bcccfc4e /xt | |
parent | d152464da8e9a71b2a39c6b628627a9433f5706a (diff) | |
download | public-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.t | 10 |
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; |