fluent / fluentd

Fluentd: Unified Logging Layer (project under CNCF)
https://www.fluentd.org
Apache License 2.0
12.86k stars 1.34k forks source link

CI: Some tests about signal handlers sometimes fail #4063

Open daipom opened 1 year ago

daipom commented 1 year ago

Describe the bug

test_cont_in_main_process_signal_handlers and test_cont_in_supervisor_signal_handler of SupervisorTest sometimes fail.

===============================================================================
Failure: test_cont_in_main_process_signal_handlers(SupervisorTest):
  class()
  Called 0 times.
  Expected 1 times.
/opt/hostedtoolcache/Ruby/3.0.5/x64/lib/ruby/gems/3.0.0/gems/sigdump-0.2.4/lib/sigdump.rb:74:in `block in dump_object_count'
/opt/hostedtoolcache/Ruby/3.0.5/x64/lib/ruby/gems/3.0.0/gems/sigdump-0.2.4/lib/sigdump.rb:73:in `each_object'
/opt/hostedtoolcache/Ruby/3.0.5/x64/lib/ruby/gems/3.0.0/gems/sigdump-0.2.4/lib/sigdump.rb:73:in `dump_object_count'
/opt/hostedtoolcache/Ruby/3.0.5/x64/lib/ruby/gems/3.0.0/gems/sigdump-0.2.4/lib/sigdump.rb:18:in `block in dump'
/opt/hostedtoolcache/Ruby/3.0.5/x64/lib/ruby/gems/3.0.0/gems/sigdump-0.2.4/lib/sigdump.rb:136:in `open'
/opt/hostedtoolcache/Ruby/3.0.5/x64/lib/ruby/gems/3.0.0/gems/sigdump-0.2.4/lib/sigdump.rb:136:in `_open_dump_path'
/opt/hostedtoolcache/Ruby/3.0.5/x64/lib/ruby/gems/3.0.0/gems/sigdump-0.2.4/lib/sigdump.rb:14:in `dump'
/home/runner/work/fluentd/fluentd/lib/fluent/supervisor.rb:1027:in `dump_non_windows'
/home/runner/work/fluentd/fluentd/lib/fluent/supervisor.rb:943:in `block in install_main_process_signal_handlers'
/home/runner/work/fluentd/fluentd/test/test_supervisor.rb:221:in `kill'
/home/runner/work/fluentd/fluentd/test/test_supervisor.rb:221:in `test_cont_in_main_process_signal_handlers'
     218:     sv = Fluent::Supervisor.new(opts)
     219:     sv.send(:install_main_process_signal_handlers)
     220: 
  => 221:     Process.kill :CONT, Process.pid
     222: 
     223:     sleep 1
     224: 
===============================================================================
F
===============================================================================
Failure: test_cont_in_supervisor_signal_handler(SupervisorTest):
  class()
  Called 0 times.
  Expected 1 times.
/opt/hostedtoolcache/Ruby/3.0.5/x64/lib/ruby/gems/3.0.0/gems/sigdump-0.2.4/lib/sigdump.rb:74:in `block in dump_object_count'
/opt/hostedtoolcache/Ruby/3.0.5/x64/lib/ruby/gems/3.0.0/gems/sigdump-0.2.4/lib/sigdump.rb:73:in `each_object'
/opt/hostedtoolcache/Ruby/3.0.5/x64/lib/ruby/gems/3.0.0/gems/sigdump-0.2.4/lib/sigdump.rb:73:in `dump_object_count'
/opt/hostedtoolcache/Ruby/3.0.5/x64/lib/ruby/gems/3.0.0/gems/sigdump-0.2.4/lib/sigdump.rb:18:in `block in dump'
/opt/hostedtoolcache/Ruby/3.0.5/x64/lib/ruby/gems/3.0.0/gems/sigdump-0.2.4/lib/sigdump.rb:136:in `open'
/opt/hostedtoolcache/Ruby/3.0.5/x64/lib/ruby/gems/3.0.0/gems/sigdump-0.2.4/lib/sigdump.rb:136:in `_open_dump_path'
/opt/hostedtoolcache/Ruby/3.0.5/x64/lib/ruby/gems/3.0.0/gems/sigdump-0.2.4/lib/sigdump.rb:14:in `dump'
/home/runner/work/fluentd/fluentd/lib/fluent/supervisor.rb:1027:in `dump_non_windows'
/home/runner/work/fluentd/fluentd/lib/fluent/supervisor.rb:943:in `block in install_main_process_signal_handlers'
/home/runner/work/fluentd/fluentd/test/test_supervisor.rb:305:in `kill'
/home/runner/work/fluentd/fluentd/test/test_supervisor.rb:305:in `test_cont_in_supervisor_signal_handler'
     302:     server = DummyServer.new
     303:     server.install_supervisor_signal_handlers
     304: 
  => 305:     Process.kill :CONT, Process.pid
     306: 
     307:     sleep 1
     308: 
===============================================================================

This is similar to 0d126dedf131637fad7d6dabf8a9c86fd5cf3eca

To Reproduce

I can't reproduce this on my local yet.

In CI, sometimes these tests fail on Ubuntu.

Expected behavior

The tests always succeed.

Your Environment

None

Your Configuration

None

Your Error Log

None

Additional context

No response

daipom commented 1 day ago

I'm not sure, but I remember this issue started after the following fix.