From: Eric Wong <e@yhbt.net>
To: meta@public-inbox.org
Subject: [PATCH 3/4] t/ds-leak: use BSD::Resource
Date: Sun, 19 Apr 2020 23:19:36 +0000 [thread overview]
Message-ID: <20200419231937.56365-4-e@yhbt.net> (raw)
In-Reply-To: <20200419231937.56365-1-e@yhbt.net>
We use BSD::Resource in other places, so there's no sense
in avoiding it, here.
---
t/ds-leak.t | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/t/ds-leak.t b/t/ds-leak.t
index ea0eeaa6..b29d814e 100644
--- a/t/ds-leak.t
+++ b/t/ds-leak.t
@@ -6,6 +6,7 @@
use strict;
use warnings;
use Test::More;
+use PublicInbox::TestCommon;
use_ok 'PublicInbox::DS';
if ('close-on-exec for epoll and kqueue') {
@@ -44,8 +45,9 @@ if ('close-on-exec for epoll and kqueue') {
}
SKIP: {
- # not bothering with BSD::Resource
- chomp(my $n = `/bin/sh -c 'ulimit -n'`);
+ require_mods('BSD::Resource', 1);
+ my $rlim = BSD::Resource::RLIMIT_NOFILE();
+ my ($n,undef) = BSD::Resource::getrlimit($rlim);
# FreeBSD 11.2 with 2GB RAM gives RLIMIT_NOFILE=57987!
if ($n > 1024 && !$ENV{TEST_EXPENSIVE}) {
next prev parent reply other threads:[~2020-04-19 23:19 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-19 23:19 [PATCH 0/4] test speedups for FreeBSD Eric Wong
2020-04-19 23:19 ` [PATCH 1/4] import: init_bare: allow use as method, use in tests Eric Wong
2020-04-19 23:19 ` [PATCH 2/4] import: init_bare: use pure Perl Eric Wong
2020-04-19 23:19 ` Eric Wong [this message]
2020-04-19 23:19 ` [PATCH 4/4] testcommon: spawn-aware system() and qx[] workalikes Eric Wong
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://public-inbox.org/README
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200419231937.56365-4-e@yhbt.net \
--to=e@yhbt.net \
--cc=meta@public-inbox.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).