From cef288eb427958c45f0e08cf1fd0ce0234107a21 Mon Sep 17 00:00:00 2001 From: Eric Tune Date: Fri, 12 Feb 2016 15:24:57 -0800 Subject: [PATCH] Warn when not enough FDs Helps debug problem when running tests on OS X. --- hack/test-go.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/hack/test-go.sh b/hack/test-go.sh index 5d3c5124c16..8f060a9e747 100755 --- a/hack/test-go.sh +++ b/hack/test-go.sh @@ -303,6 +303,17 @@ reportCoverageToCoveralls() { fi } +checkFDs() { + # several unittests panic when httptest cannot open more sockets + # due to the low default files limit on OS X. Warn about low limit. + local fileslimit="$(ulimit -n)" + if [[ $fileslimit -lt 1000 ]]; then + echo "WARNING: ulimit -n (files) should be at least 1000, is $fileslimit, may cause test failure"; + fi +} + +checkFDs + # Convert the CSVs to arrays. IFS=';' read -a apiVersions <<< "${KUBE_TEST_API_VERSIONS}" IFS=',' read -a etcdPrefixes <<< "${KUBE_TEST_ETCD_PREFIXES}"