From 4e16380ab7f2aa51219e3362dcb03fa481a90d74 Mon Sep 17 00:00:00 2001 From: "yang.wang" Date: Wed, 30 Aug 2017 16:32:49 +0800 Subject: [PATCH] run-make-check.sh: run ulimit without sudo ulimit is a shell builtin like cd, not a separate program. sudo looks for a binary to run, but there is no ulimit binary, then you will get an error message like: "sudo: ulimit: command not found" ulimit can only be run with root if you want raise the ulimit -n Change-Id: I59ab09240cb15cabe5b0a7342c3f562cd50c75e9 Signed-off-by: yang.wang --- run-make-check.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/run-make-check.sh b/run-make-check.sh index 6b9ed29f63a..75e7d92b683 100755 --- a/run-make-check.sh +++ b/run-make-check.sh @@ -71,8 +71,13 @@ function run() { $DRY_RUN ./do_cmake.sh $@ || return 1 $DRY_RUN cd build $DRY_RUN make $BUILD_MAKEOPTS tests || return 1 - # prevent OSD EMFILE death on tests - $DRY_RUN sudo ulimit -n 32768 + # prevent OSD EMFILE death on tests, make sure large than 1024 + $DRY_RUN ulimit -n $(ulimit -Hn) + if [ $(ulimit -n) -lt 1024 ];then + echo "***ulimit -n too small, better bigger than 1024 for test***" + return 1 + fi + if ! $DRY_RUN ctest $CHECK_MAKEOPTS --output-on-failure; then rm -f ${TMPDIR:-/tmp}/ceph-asok.* return 1 -- 2.39.5