From 424612ea9dd30fe3a8654757d6d3982835a92a9e Mon Sep 17 00:00:00 2001 From: Michael Vines Date: Tue, 4 Dec 2018 19:56:23 -0800 Subject: [PATCH] Reduce |ulimit -n| on macOS to max supported amount --- ci/test-stable.sh | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/ci/test-stable.sh b/ci/test-stable.sh index 4adede9f0e..e0480e62d0 100755 --- a/ci/test-stable.sh +++ b/ci/test-stable.sh @@ -12,8 +12,15 @@ _() { "$@" } -if [[ $(ulimit -n) -lt 65000 ]]; then - ulimit -n 65000 || echo 'Error: nofiles too small, run "ulimit -n 65000" to continue' && exit 1 +maxOpenFds=65000 +if [[ $(uname) = Darwin ]]; then + maxOpenFds=24576 # Appears to be the max permitted on macOS... +fi +if [[ $(ulimit -n) -lt $maxOpenFds ]]; then + ulimit -n $maxOpenFds|| { + echo 'Error: nofiles too small, run "ulimit -n 65000" to continue'; + exit 1 + } fi _ cargo build --all --verbose