Skip to content

Backport(v1.19): test_out_exec_filter: fix flaky test on Windows (#5380)#5387

Merged
Watson1978 merged 1 commit into
v1.19from
backport-to-v1.19/pr5380
Jun 15, 2026
Merged

Backport(v1.19): test_out_exec_filter: fix flaky test on Windows (#5380)#5387
Watson1978 merged 1 commit into
v1.19from
backport-to-v1.19/pr5380

Conversation

@github-actions

Copy link
Copy Markdown

Which issue(s) this PR fixes:
Backport #5380
Fixes #

What this PR does / why we need it:
The test 'using child processes by round robin' in test_out_exec_filter.rb was occasionally failing on Windows.

Like:

3) Failure: test: using child processes by round robin[with sections](ExecFilterOutputTest)
D:/a/fluentd/fluentd/test/plugin/test_out_exec_filter.rb:533:in 'block in <class:ExecFilterOutputTest>'
     530:
     531:     assert_equal pid_list[0], events[0][2]['child_pid']
     532:     assert_equal pid_list[1], events[1][2]['child_pid']
  => 533:     assert_equal pid_list[0], events[2][2]['child_pid']
     534:     assert_equal pid_list[1], events[3][2]['child_pid']
     535:   end
     536:
<"8944"> expected but was
<"2728">

diff:
? 2728944
Error: <"8944"> expected but was
<"2728">.

The test previously assumed that the events would be processed and returned in a strictly alternating order (e.g., A -> B -> A -> B).

However, on Windows, the overhead of process creation and unpredictable I/O scheduling can cause the child processes to become ready and return events out of order (e.g., A -> B -> B -> A), resulting in false-positive test failures.

This commit fixes the flaky behavior by verifying the even distribution of events rather than their strict chronological return order.

Docs Changes:
N/A

Release Note:
N/A

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

**What this PR does / why we need it**:
The `test 'using child processes by round robin'` in
`test_out_exec_filter.rb` was occasionally failing on Windows.

Like:
```
3) Failure: test: using child processes by round robin[with sections](ExecFilterOutputTest)
D:/a/fluentd/fluentd/test/plugin/test_out_exec_filter.rb:533:in 'block in <class:ExecFilterOutputTest>'
     530:
     531:     assert_equal pid_list[0], events[0][2]['child_pid']
     532:     assert_equal pid_list[1], events[1][2]['child_pid']
  => 533:     assert_equal pid_list[0], events[2][2]['child_pid']
     534:     assert_equal pid_list[1], events[3][2]['child_pid']
     535:   end
     536:
<"8944"> expected but was
<"2728">

diff:
? 2728944
Error: <"8944"> expected but was
<"2728">.
```

The test previously assumed that the events would be processed and
returned in a strictly alternating order (e.g., A -> B -> A -> B).

However, on Windows, the overhead of process creation and unpredictable
I/O scheduling can cause the child processes to become ready and return
events out of order (e.g., A -> B -> B -> A), resulting in
false-positive test failures.

This commit fixes the flaky behavior by verifying the even distribution
of events rather than their strict chronological return order.

**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 Watson1978 added the CI Test/CI issues label Jun 15, 2026
@Watson1978 Watson1978 merged commit a16ca30 into v1.19 Jun 15, 2026
18 checks passed
@Watson1978 Watson1978 deleted the backport-to-v1.19/pr5380 branch June 15, 2026 01:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CI Test/CI issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant