Skip to content

tests: fix test_low_fd_limit failing on RLIM_INFINITY platforms#9149

Open
nGoline wants to merge 1 commit into
ElementsProject:masterfrom
nGoline:test-low-fd-limit
Open

tests: fix test_low_fd_limit failing on RLIM_INFINITY platforms#9149
nGoline wants to merge 1 commit into
ElementsProject:masterfrom
nGoline:test-low-fd-limit

Conversation

@nGoline
Copy link
Copy Markdown
Collaborator

@nGoline nGoline commented May 19, 2026

Problem

test_low_fd_limit fails on macOS and any platform where RLIMIT_NOFILE hard limit is RLIM_INFINITY (or larger than UINT32_MAX).

The test passes limits[1] and limits[1]+1 directly as --dev-fd-limit-multiplier, which is a u32 option. When the hard limit is RLIM_INFINITY (= 9223372036854775807 on macOS), both values overflow u32, opt_set_u32 returns "out of range", and lightningd exits with code 1 — causing both nodes to fail to start with:

TimeoutError: Unable to find "Server started with public key" in logs

Closes #9015

Fix

Cap to TEST_CEILING = 65536 when the hard limit is RLIM_INFINITY or exceeds the ceiling, then halve the soft limit as the test requires. The existing soft == hard halving path is preserved as the elif fallback for normal bounded limits.

🤖 Generated with Claude Code

When RLIMIT_NOFILE hard limit is RLIM_INFINITY (macOS default) or
larger than UINT32_MAX, passing limits[1] and limits[1]+1 directly as
--dev-fd-limit-multiplier (a u32 option) causes lightningd to reject
the argument as out-of-range and exit(1), making both nodes fail to
start with "Unable to find Server started with public key" timeout.

Cap to TEST_CEILING=65536 when the hard limit is RLIM_INFINITY or
exceeds the ceiling, keeping the existing soft==hard halving path for
normal bounded limits.

Changelog-None

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@nGoline nGoline requested a review from ddustin May 19, 2026 13:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant