Skip to content

Commit

Permalink
Backport(v1.16) test_in_udp: add timeout for message_length_limit test (
Browse files Browse the repository at this point in the history
#4676) (#4789)

**Which issue(s) this PR fixes**: 
Fixes #

**What this PR does / why we need it**: 

On Windows, `message_length_limit` test always take 300s for execution.

```
UdpInputTest:
  test:  configure w/o parse section:			.: (0.002351)
  test: configure[ipv4]:				.: (0.002723)
  test: configure[ipv6]:				.: (0.002602)
  test: message size with format[none]:			.: (1.029781)
  test: message size with format[json]:			.: (1.113799)
  test: message size with format[regexp]:		.: (1.110006)
  test: message_length_limit:				.: (300.538596)
```

The 300 sec comes from
https://github.com/fluent/fluentd/blob/a2b935ae2bc4b4d43e5adddbec01092ea4228b9e/lib/fluent/test/driver/base.rb#L36,
and it always times out in Windows.

This patch set a short timeout to reduce test execution time on Windows.

Backported from #4676

**Docs Changes**:

**Release Note**:

Signed-off-by: Watson <fujita@clear-code.com>
Signed-off-by: Kentaro Hayashi <hayashi@clear-code.com>
Co-authored-by: Watson <fujita@clear-code.com>
  • Loading branch information
kenhys and Watson1978 authored Jan 29, 2025
1 parent 0c5b764 commit 5c08ab6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion test/plugin/test_in_udp.rb
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ def create_udp_socket(host, port)
format none
message_length_limit #{message_length_limit}
!)
d.run(expect_records: 3) do
d.run(expect_records: 3, timeout: 5) do
create_udp_socket('127.0.0.1', @port) do |u|
3.times do |i|
u.send("#{i}" * 40 + "\n", 0)
Expand Down

0 comments on commit 5c08ab6

Please sign in to comment.