Skip to content
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
1 change: 1 addition & 0 deletions .github/workflows/macos.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ jobs:
PYTEST_OPTS: "-vvv --timeout=1800 --durations=10"
PYTEST_TESTS: |
tests/test_misc.py::test_ipv4_and_ipv6
tests/test_misc.py::test_low_fd_limit
tests/test_connection.py::test_websocket
tests/test_connection.py::test_wss_proxy
tests/test_plugin.py::test_inline_plugin_wait_for_log_no_selfmatch
Expand Down
12 changes: 10 additions & 2 deletions tests/test_misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -4998,8 +4998,16 @@ def test_set_feerate_offset(node_factory, bitcoind):
def test_low_fd_limit(node_factory, bitcoind):
limits = resource.getrlimit(resource.RLIMIT_NOFILE)

# We assume this, otherwise l2 cannot increase limits!
if limits[0] == limits[1]:
# dev-fd-limit-multiplier is a u32, so values > UINT32_MAX fail option
# parsing. macOS also reports RLIM_INFINITY as the hard limit, making
# "ask for more than the hard limit" meaningless. Cap to a bounded
# ceiling so the test works on any platform.
TEST_CEILING = 65536
if limits[1] == resource.RLIM_INFINITY or limits[1] > TEST_CEILING:
limits = (TEST_CEILING // 2, TEST_CEILING)
resource.setrlimit(resource.RLIMIT_NOFILE, limits)
elif limits[0] == limits[1]:
# We assume this, otherwise l2 cannot increase limits!
limits = (limits[1] // 2, limits[1])
resource.setrlimit(resource.RLIMIT_NOFILE, limits)

Expand Down
Loading