This is an automated email from the ASF dual-hosted git repository.
spacewander pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/apisix.git
The following commit(s) were added to refs/heads/master by this push:
new c4c10e1 test: dismiss the ulimit too small warn (#5153)
c4c10e1 is described below
commit c4c10e1a0cadc1f927afa6da621d6e6d23d1e9e9
Author: 罗泽轩 <[email protected]>
AuthorDate: Thu Sep 30 11:06:30 2021 +0800
test: dismiss the ulimit too small warn (#5153)
---
apisix/cli/ops.lua | 7 ++++---
ci/linux_apisix_current_luarocks_runner.sh | 7 ++++++-
2 files changed, 10 insertions(+), 4 deletions(-)
diff --git a/apisix/cli/ops.lua b/apisix/cli/ops.lua
index ebacd3b..e179522 100644
--- a/apisix/cli/ops.lua
+++ b/apisix/cli/ops.lua
@@ -310,11 +310,12 @@ local function init(env)
.. 'other than /root.')
end
- if env.ulimit <= 1024 then
+ local min_ulimit = 1024
+ if env.ulimit <= min_ulimit then
print(str_format("Warning! Current maximum number of open file "
- .. "descriptors [%d] is too small, please increase user limits
by "
+ .. "descriptors [%d] is not greater than %d, please increase
user limits by "
.. "execute \'ulimit -n <new user limits>\' , otherwise the
performance"
- .. " is low.", env.ulimit))
+ .. " is low.", env.ulimit, min_ulimit))
end
-- read_yaml_conf
diff --git a/ci/linux_apisix_current_luarocks_runner.sh
b/ci/linux_apisix_current_luarocks_runner.sh
index 3ca7c0e..d93cf47 100755
--- a/ci/linux_apisix_current_luarocks_runner.sh
+++ b/ci/linux_apisix_current_luarocks_runner.sh
@@ -61,8 +61,13 @@ script() {
# install test dependencies
sudo pip install requests
+ # dismiss "maximum number of open file descriptors too small" warning
+ ulimit -n 10240
+ ulimit -n -S
+ ulimit -n -H
+
for f in ./t/cli/test_*.sh; do
- sudo PATH="$PATH" "$f"
+ PATH="$PATH" "$f"
done
}