Re: [BUG?] setting ulimit in test suite broken for me

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]