Skip to content

Conversation

@Watson1978
Copy link
Contributor

Backport #5174

Which issue(s) this PR fixes:
This patch will fix following failures on Windows with old Ruby (3.0, 2.7).

1) Failure: test_supervisor_event_handler(SupervisorTest): <false> is not true.
D:/a/fluentd/fluentd/test/test_supervisor.rb:388:in `test_supervisor_event_handler'
     385: 
     386:     debug_msg = '[debug]: Got Win32 event "TestFluentdEvent_USR1"'
     387:     logs = $log.out.logs
  => 388:     assert{ logs.any?{|log| log.include?(debug_msg) } }
     389:   ensure
     390:     $log.out.reset if $log&.out&.respond_to?(:reset)
     391:   end

2) Failure: test_windows_shutdown_event(SupervisorTest): <false> is not true.
D:/a/fluentd/fluentd/test/test_supervisor.rb:362:in `test_windows_shutdown_event'
     359: 
     360:     debug_msg = '[debug]: Got Win32 event "TestFluentdEvent"'
     361:     logs = $log.out.logs
  => 362:     assert{ logs.any?{|log| log.include?(debug_msg) } }
     363:   ensure
     364:     $log.out.reset if $log&.out&.respond_to?(:reset)
     365:   end

https://github.com/fluent/fluentd/actions/runs/19950323545/job/57208741261

What this PR does / why we need it:
It seems we need to wait a bit to reliably capture events as logs.

Similar to following codes, this also includes sleep.

sleep 0.1 # Wait for starting windows event thread
event = Win32::Event.open("TestFluentdEvent_CONT")
event.set
event.close
sleep 1.0 # Wait for dumping

Docs Changes:
N/A

Release Note:
N/A

Which issue(s) this PR fixes:
Fixes #

What this PR does / why we need it:

Docs Changes:

Release Note:

**Which issue(s) this PR fixes**:
This patch will fix following failures on Windows with old Ruby (3.0,
2.7).

```
1) Failure: test_supervisor_event_handler(SupervisorTest): <false> is not true.
D:/a/fluentd/fluentd/test/test_supervisor.rb:388:in `test_supervisor_event_handler'
     385: 
     386:     debug_msg = '[debug]: Got Win32 event "TestFluentdEvent_USR1"'
     387:     logs = $log.out.logs
  => 388:     assert{ logs.any?{|log| log.include?(debug_msg) } }
     389:   ensure
     390:     $log.out.reset if $log&.out&.respond_to?(:reset)
     391:   end

2) Failure: test_windows_shutdown_event(SupervisorTest): <false> is not true.
D:/a/fluentd/fluentd/test/test_supervisor.rb:362:in `test_windows_shutdown_event'
     359: 
     360:     debug_msg = '[debug]: Got Win32 event "TestFluentdEvent"'
     361:     logs = $log.out.logs
  => 362:     assert{ logs.any?{|log| log.include?(debug_msg) } }
     363:   ensure
     364:     $log.out.reset if $log&.out&.respond_to?(:reset)
     365:   end
```


https://github.com/fluent/fluentd/actions/runs/19950323545/job/57208741261

**What this PR does / why we need it**: 
It seems we need to wait a bit to reliably capture events as logs.

Similar to following codes, this also includes sleep.


https://github.com/fluent/fluentd/blob/6d26f8de536601d9c192476f00cd22925a8882ad/test/test_supervisor.rb#L417-L421

**Docs Changes**:
N/A

**Release Note**: 
N/A

Signed-off-by: Shizuo Fujita <[email protected]>
@Watson1978 Watson1978 requested a review from kenhys December 5, 2025 06:41
@Watson1978 Watson1978 added this to the v1.16.11 milestone Dec 5, 2025
@Watson1978 Watson1978 added the CI Test/CI issues label Dec 5, 2025
Copy link
Contributor

@kenhys kenhys left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

wait CI to pass.

@kenhys kenhys merged commit 4ed7237 into v1.16 Dec 5, 2025
43 of 44 checks passed
@kenhys kenhys deleted the backport-to-1.16/pr5174 branch December 5, 2025 07:37
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.

3 participants