提交 c318e347 作者: Steven Allen

fix ulimit tests

Not sure why CI wasn't failing.

License: MIT
Signed-off-by: 's avatarSteven Allen <steven@stebalien.com>
上级 4b7a24f0
......@@ -16,7 +16,7 @@ func TestManageFdLimit(t *testing.T) {
t.Errorf("Cannot manage file descriptors")
}
if maxFds != uint64(2048) {
if maxFds != uint64(8192) {
t.Errorf("Maximum file descriptors default value changed")
}
}
......@@ -38,16 +38,13 @@ func TestManageInvalidNFds(t *testing.T) {
t.Fatal("Cannot set the IPFS_FD_MAX env variable")
}
// call to check and set the maximum file descriptor from the env
setMaxFds()
if _, _, err := ManageFdLimit(); err == nil {
t.Errorf("ManageFdLimit should return an error")
} else if err != nil {
flag := strings.Contains(err.Error(),
"cannot set rlimit, IPFS_FD_MAX is larger than the hard limit")
"failed to raise ulimit to IPFS_FD_MAX")
if !flag {
t.Errorf("ManageFdLimit returned unexpected error")
t.Error("ManageFdLimit returned unexpected error", err)
}
}
......@@ -74,11 +71,6 @@ func TestManageFdLimitWithEnvSet(t *testing.T) {
t.Fatal("Cannot set the IPFS_FD_MAX env variable")
}
setMaxFds()
if maxFds != uint64(value) {
t.Errorf("The maxfds is not set from IPFS_FD_MAX")
}
if _, _, err = ManageFdLimit(); err != nil {
t.Errorf("Cannot manage file descriptor count")
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论