Skip to content

Commit

Permalink
Backport(v1.16) ci: fix unstable test (#4820)
Browse files Browse the repository at this point in the history
**Which issue(s) this PR fixes**:
None.

**What this PR does / why we need it**:
Fix unstable test.

```
Error: test: creates a udp server to read and write data using IPv6(ServerPluginHelperTest::#server_create_udp): Errno::EADDRINUSE: Address already in use - bind(2) for "::1" port 8859
/home/runner/work/fluentd/fluentd/test/plugin_helper/test_server.rb:697:in 'UDPSocket#bind'
/home/runner/work/fluentd/fluentd/test/plugin_helper/test_server.rb:697:in 'block (3 levels) in <class:ServerPluginHelperTest>'
<internal:numeric>:257:in 'Integer#times'
/home/runner/work/fluentd/fluentd/test/plugin_helper/test_server.rb:694:in 'block (2 levels) in <class:ServerPluginHelperTest>'
```

**Docs Changes**:
Not needed.

**Release Note**:
The same as the title.

Signed-off-by: Daijiro Fukuda <fukuda@clear-code.com>
  • Loading branch information
daipom committed Feb 4, 2025
1 parent 6e7d056 commit f748d42
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions test/plugin_helper/test_server.rb
Original file line number Diff line number Diff line change
Expand Up @@ -668,12 +668,12 @@ class Dummy < Fluent::Plugin::TestBase

received = ""
responses = []
port = unused_port(protocol: :udp)
port = unused_port(protocol: :udp, bind: "::1")
@d.server_create_udp(:s, port, bind: "::1", max_bytes: 128) do |data, sock|
received << data
sock.write "ack\n"
end
bind_port = unused_port(protocol: :udp)
bind_port = unused_port(protocol: :udp, bind: "::1")
3.times do
begin
sock = UDPSocket.new(Socket::AF_INET6)
Expand Down

0 comments on commit f748d42

Please sign in to comment.