tests: fix test_low_fd_limit failing on RLIM_INFINITY platforms#9149
Open
nGoline wants to merge 1 commit into
Open
tests: fix test_low_fd_limit failing on RLIM_INFINITY platforms#9149nGoline wants to merge 1 commit into
nGoline wants to merge 1 commit into
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
test_low_fd_limitfails on macOS and any platform whereRLIMIT_NOFILEhard limit isRLIM_INFINITY(or larger thanUINT32_MAX).The test passes
limits[1]andlimits[1]+1directly as--dev-fd-limit-multiplier, which is a u32 option. When the hard limit isRLIM_INFINITY(=9223372036854775807on macOS), both values overflow u32,opt_set_u32returns "out of range", and lightningd exits with code 1 — causing both nodes to fail to start with:Closes #9015
Fix
Cap to
TEST_CEILING = 65536when the hard limit isRLIM_INFINITYor exceeds the ceiling, then halve the soft limit as the test requires. The existingsoft == hardhalving path is preserved as theeliffallback for normal bounded limits.🤖 Generated with Claude Code