From: Jeff King <peff@peff.net>
To: Stefan Beller <sbeller@google.com>
Cc: git@vger.kernel.org, jeanjacques.lafay@gmail.com
Subject: Re: [BUG?] setting ulimit in test suite broken for me
Date: Wed, 21 Jan 2015 14:03:49 -0500 [thread overview]
Message-ID: <20150121190348.GA29891@peff.net> (raw)
In-Reply-To: <1421866746-29444-1-git-send-email-sbeller@google.com>
On Wed, Jan 21, 2015 at 10:59:06AM -0800, Stefan Beller wrote:
> so I wanted to create a new test for large transactions, which should look like:
>
> run_with_limited_open_files () {
> (ulimit -n 64 && "$@")
> }
>
> test_lazy_prereq ULIMIT 'run_with_limited_open_files true'
>
> test_expect_success ULIMIT 'large transaction creating branches does not burst open file limit' '
> (
> echo $(ulimit -n)
> for i in $(seq 65)
> do
> echo "create refs/heads/$i HEAD"
> done >large_input &&
> git update-ref --stdin <large_input &&
> git rev-parse --verify -q refs/heads/65
> )
> '
>
> Mind the "echo $(ulimit -n)" in there as a debugging output.
> So if I run the test with "-d -v" to actually see the debugging output,
> I see ulimit -n set to 32768 instead of the desired 64.
You define run_with_limited_open_files, which starts a subshell, drops
the limit inside the subshell, and then spawns the child. But you never
call it in the test. Were you expecting that tests with the ULIMIT
prereq to automatically respect the limit? The prereq is just about
checking whether we can set the ulimit at all.
Try:
run_with_limited_open_files ulimit -n
in your debugging statement (and of course use run_with... for the
actual git command you want to limit).
-Peff
next prev parent reply other threads:[~2015-01-21 19:03 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-21 18:59 [BUG?] setting ulimit in test suite broken for me Stefan Beller
2015-01-21 19:03 ` Jeff King [this message]
2015-01-22 0:54 ` Stefan Beller
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20150121190348.GA29891@peff.net \
--to=peff@peff.net \
--cc=git@vger.kernel.org \
--cc=jeanjacques.lafay@gmail.com \
--cc=sbeller@google.com \
/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 NNTP newsgroup(s).