@cryptotaxi247 / kubo / commits / c318e3472

fix ulimit tests

Not sure why CI wasn't failing. License: MIT Signed-off-by: Steven Allen <steven@stebalien.com>

Steven Allen committed May 10, 2019 at 23:20 UTC c318e3472ebc3ca6f30a17fdf24b99992145b404
1 file changed +3 -11
cmd/ipfs/util/ulimit_test.go
+3 -11
@@ -16,7 +16,7 @@ func TestManageFdLimit(t *testing.T) {
16 t.Errorf("Cannot manage file descriptors")
17 }
18
19 - if maxFds != uint64(2048) {
19 + if maxFds != uint64(8192) {
20 t.Errorf("Maximum file descriptors default value changed")
21 }
22 }
@@ -38,16 +38,13 @@ func TestManageInvalidNFds(t *testing.T) {
38 t.Fatal("Cannot set the IPFS_FD_MAX env variable")
39 }
40
41 - // call to check and set the maximum file descriptor from the env
42 - setMaxFds()
43 -
41 if _, _, err := ManageFdLimit(); err == nil {
42 t.Errorf("ManageFdLimit should return an error")
43 } else if err != nil {
44 flag := strings.Contains(err.Error(),
48 - "cannot set rlimit, IPFS_FD_MAX is larger than the hard limit")
45 + "failed to raise ulimit to IPFS_FD_MAX")
46 if !flag {
50 - t.Errorf("ManageFdLimit returned unexpected error")
47 + t.Error("ManageFdLimit returned unexpected error", err)
48 }
49 }
50
@@ -74,11 +71,6 @@ func TestManageFdLimitWithEnvSet(t *testing.T) {
71 t.Fatal("Cannot set the IPFS_FD_MAX env variable")
72 }
73
77 - setMaxFds()
78 - if maxFds != uint64(value) {
79 - t.Errorf("The maxfds is not set from IPFS_FD_MAX")
80 - }
81 -
74 if _, _, err = ManageFdLimit(); err != nil {
75 t.Errorf("Cannot manage file descriptor count")
76 }