提交 af914c51 作者: Jeromy

add better test to be more sure that file descriptor limits were actually raised

License: MIT
Signed-off-by: 's avatarJeromy <why@ipfs.io>
上级 6c340563
......@@ -189,6 +189,12 @@
"hash": "QmVvJ27GcLaLSXvcB4auk3Gn3xuWK5ti5ENkZ2pCoJEYW4",
"name": "autobatch",
"version": "0.2.0"
},
{
"author": "whyrusleeping",
"hash": "QmdCL8M8DXJdSRnwhpDhukX5r8ydjxnzPJpaKrFudDA8yn",
"name": "hang-fds",
"version": "0.0.0"
}
],
"gxVersion": "0.4.0",
......
......@@ -60,10 +60,18 @@ multihash_src:
$(eval MULTIHASH_HASH := $(shell cd .. && bin/gx deps find go-multihash))
$(eval MULTIHASH_SRC := gx/ipfs/$(MULTIHASH_HASH)/go-multihash)
hang-fds_src:
$(eval HANG_FDS_HASH := $(shell cd .. && bin/gx deps find hang-fds))
$(eval HANG_FDS_SRC := gx/ipfs/$(HANG_FDS_HASH)/hang-fds)
bin/multihash: multihash_src $(call find_go_files, $(MULTIHASH_SRC)) IPFS-BUILD-OPTIONS
@echo "*** installing $@ ***"
go build $(GOFLAGS) -o bin/multihash $(MULTIHASH_SRC)/multihash
bin/hang-fds: hang-fds_src $(call find_go_files, $(HANG_FDS_SRC)) IPFS-BUILD-OPTIONS
@echo "*** installing $@ ***"
go build $(GOFLAGS) -o bin/hang-fds $(HANG_FDS_SRC)
iptb_src:
$(eval IPTB_HASH := $(shell cd .. && bin/gx deps find iptb))
$(eval IPTB_SRC := gx/ipfs/$(IPTB_HASH)/iptb)
......
......@@ -8,7 +8,7 @@
T = $(sort $(wildcard t[0-9][0-9][0-9][0-9]-*.sh))
BINS = bin/random bin/multihash bin/ipfs bin/pollEndpoint \
bin/iptb bin/go-sleep bin/random-files bin/go-timeout
bin/iptb bin/go-sleep bin/random-files bin/go-timeout bin/hang-fds
SHARNESS = lib/sharness/sharness.sh
IPFS_ROOT = ../..
......
......@@ -129,21 +129,13 @@ test_expect_success "daemon raised its fd limit" '
grep "raised file descriptor limit to 1024." actual_daemon > /dev/null
'
get_col_four() {
awk '{ print $4 }' $1
}
if [ `uname` == "Linux" ]; then
test_expect_success "get fd limit through /proc" '
cat /proc/$IPFS_PID/limits > limits &&
grep "Max open files" limits > fd_limits_line &&
limit=$(get_col_four fd_limits_line)
'
test_expect_success "limit from system looks good" '
test "$limit" -eq 1024
'
fi
test_expect_success "daemon actually can handle 1024 file descriptors" '
hang-fds -hold=2s 1000 '$API_MADDR'
'
test_expect_success "daemon didnt throw any errors" '
test_expect_code 1 grep "too many open files" daemon_err
'
test_kill_ipfs_daemon
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论