Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add a test for auto-raising ulimit #2891

Merged
merged 1 commit into from
Jun 23, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions test/sharness/lib/test-lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,8 @@ test_launch_ipfs_daemon() {

args="$@"

test "$TEST_ULIMIT_PRESET" != 1 && ulimit -n 1024

test_expect_success "'ipfs daemon' succeeds" '
ipfs daemon $args >actual_daemon 2>daemon_err &
'
Expand Down
10 changes: 10 additions & 0 deletions test/sharness/t0060-daemon.sh
Original file line number Diff line number Diff line change
Expand Up @@ -121,4 +121,14 @@ test_expect_success "daemon with pipe eventually becomes live" '
test_fsh cat stdin_daemon_out || test_fsh cat stdin_daemon_err || test_fsh cat stdin_poll_apiout || test_fsh cat stdin_poll_apierr
'

ulimit -n 512
TEST_ULIMIT_PRESET=1
test_launch_ipfs_daemon

test_expect_success "daemon raised its fd limit" '
grep "ulimit" actual_daemon > /dev/null
Copy link
Member

@jbenet jbenet Aug 27, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should have a way to check the number. this test does not test the thing in question, it only checks that a word exists in a message printed. Check the number it was raised to. if you can, verify that it was indeed raised with os cmds or something. or through some /debug api route

'

test_kill_ipfs_daemon

test_done