Backport(v1.19): test: fix unused ports outside the OS dynamic port range (#5451) - #5460
Merged
Conversation
**Which issue(s) this PR fixes**: Fixes # **What this PR does / why we need it**: On Windows, Hyper-V/WinNAT/HNS take their reservations from the dynamic port range, which is 49152-65535 as observed on GitHub Actions runners, and a reservation can appear between the check and the actual bind. When searching for unused ports, this PR will avoid this range to prevent following error. ``` 3) Error: test: send_with_time_as_integer(ForwardOutputTest): Errno::EACCES: Permission denied - bind(2) for 127.0.0.1:58707 C:/hostedtoolcache/windows/Ruby/4.0.5/arm64/lib/ruby/4.0.0/socket.rb:183:in 'Socket#bind' C:/hostedtoolcache/windows/Ruby/4.0.5/arm64/lib/ruby/4.0.0/socket.rb:183:in 'Addrinfo#bind' C:/a/fluentd/fluentd/lib/fluent/plugin_helper/server.rb:402:in 'Fluent::PluginHelper::Server#server_create_udp_socket' C:/a/fluentd/fluentd/lib/fluent/plugin_helper/server.rb:178:in 'Fluent::PluginHelper::Server#server_create' C:/a/fluentd/fluentd/lib/fluent/plugin/in_forward.rb:192:in 'Fluent::Plugin::ForwardInput#start' C:/a/fluentd/fluentd/lib/fluent/test/driver/base.rb:120:in 'Fluent::Test::Driver::Base#instance_start' C:/a/fluentd/fluentd/lib/fluent/test/driver/base.rb:78:in 'Fluent::Test::Driver::Base#run' C:/a/fluentd/fluentd/lib/fluent/test/driver/base_owner.rb:130:in 'Fluent::Test::Driver::BaseOwner#run' C:/a/fluentd/fluentd/test/plugin/test_out_forward.rb:516:in 'block (2 levels) in <class:ForwardOutputTest>' C:/hostedtoolcache/windows/Ruby/4.0.5/arm64/lib/ruby/gems/4.0.0/gems/test-unit-rr-1.0.5/lib/test/unit/rr.rb:98:in 'Test::Unit::RR::Adapter#assert_rr' C:/a/fluentd/fluentd/test/plugin/test_out_forward.rb:515:in 'block in <class:ForwardOutputTest>' ``` https://github.com/fluent/fluentd/actions/runs/29884012909/job/88810722450#step:6:5337 Related to #5434 **Docs Changes**: N/A **Release Note**: N/A Signed-off-by: Shizuo Fujita <fujita@clear-code.com> Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Watson1978
approved these changes
Aug 2, 2026
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.
Which issue(s) this PR fixes:
Backport #5451
Fixes #
What this PR does / why we need it:
On Windows, Hyper-V/WinNAT/HNS take their reservations from the dynamic port range, which is 49152-65535 as observed on GitHub Actions runners, and a reservation can appear between the check and the actual bind.
When searching for unused ports, this PR will avoid this range to prevent following error.
https://github.com/fluent/fluentd/actions/runs/29884012909/job/88810722450#step:6:5337
Related to #5434
Docs Changes:
N/A
Release Note:
N/A