-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
test_out_forward: Fix a failed test on Ruby 3.2 on Windows #3968
Conversation
Fluent::Test::Driver::Base#instance_shutdown causes rase on Ruby 3.2 on Windows. I'm not sure the detailed mechanism of this issue but exiting the test driver normally doesn't cause it. ``` 2022-09-15T04:02:03.9921391Z #<Thread:0x000001ddefc90b20@event_loop D:/a/fluentd/fluentd/lib/fluent/plugin_helper/thread.rb:70 run> terminated with exception (report_on_exception is true): 2022-09-15T04:02:03.9948504Z D:/rubyinstaller-head-x64/lib/ruby/gems/3.2.0+2/gems/cool.io-1.7.1/lib/cool.io/io.rb:35:in `attach': expected loop to be an instance of Coolio::Loop, not nil (ArgumentError) 2022-09-15T04:02:03.9948899Z 2022-09-15T04:02:03.9949030Z @_read_watcher.attach(loop) 2022-09-15T04:02:03.9949263Z ^^^^ 2022-09-15T04:02:03.9949760Z from D:/rubyinstaller-head-x64/lib/ruby/gems/3.2.0+2/gems/cool.io-1.7.1/lib/cool.io/io.rb:35:in `attach' 2022-09-15T04:02:03.9950342Z from D:/rubyinstaller-head-x64/lib/ruby/gems/3.2.0+2/gems/cool.io-1.7.1/lib/cool.io/socket.rb:39:in `attach' 2022-09-15T04:02:03.9950654Z from (eval):7:in `attach' 2022-09-15T04:02:03.9951144Z from D:/rubyinstaller-head-x64/lib/ruby/gems/3.2.0+2/gems/cool.io-1.7.1/lib/cool.io/server.rb:40:in `on_connection' 2022-09-15T04:02:03.9951733Z from D:/rubyinstaller-head-x64/lib/ruby/gems/3.2.0+2/gems/cool.io-1.7.1/lib/cool.io/listener.rb:65:in `on_readable' 2022-09-15T04:02:03.9952292Z from D:/rubyinstaller-head-x64/lib/ruby/gems/3.2.0+2/gems/cool.io-1.7.1/lib/cool.io/loop.rb:88:in `run_once' 2022-09-15T04:02:03.9952792Z from D:/rubyinstaller-head-x64/lib/ruby/gems/3.2.0+2/gems/cool.io-1.7.1/lib/cool.io/loop.rb:88:in `run' 2022-09-15T04:02:03.9953233Z from D:/a/fluentd/fluentd/lib/fluent/plugin_helper/event_loop.rb:93:in `block in start' 2022-09-15T04:02:03.9953646Z from D:/a/fluentd/fluentd/lib/fluent/plugin_helper/thread.rb:78:in `block in thread_create' 2022-09-15T04:02:04.9796436Z Started 2022-09-15T04:02:04.9796980Z E 2022-09-15T04:02:04.9797374Z =============================================================================== 2022-09-15T04:02:04.9803849Z Error: test: Create connection per send_data(ForwardOutputTest::keepalive::with require_ack_response): ArgumentError: expected loop to be an instance of Coolio::Loop, not nil 2022-09-15T04:02:04.9805379Z D:/rubyinstaller-head-x64/lib/ruby/gems/3.2.0+2/gems/cool.io-1.7.1/lib/cool.io/io.rb:35:in `attach' 2022-09-15T04:02:04.9806300Z D:/rubyinstaller-head-x64/lib/ruby/gems/3.2.0+2/gems/cool.io-1.7.1/lib/cool.io/io.rb:35:in `attach' 2022-09-15T04:02:04.9807276Z D:/rubyinstaller-head-x64/lib/ruby/gems/3.2.0+2/gems/cool.io-1.7.1/lib/cool.io/socket.rb:39:in `attach' 2022-09-15T04:02:04.9807673Z (eval):7:in `attach' 2022-09-15T04:02:04.9808146Z D:/rubyinstaller-head-x64/lib/ruby/gems/3.2.0+2/gems/cool.io-1.7.1/lib/cool.io/server.rb:40:in `on_connection' 2022-09-15T04:02:04.9808662Z D:/rubyinstaller-head-x64/lib/ruby/gems/3.2.0+2/gems/cool.io-1.7.1/lib/cool.io/listener.rb:65:in `on_readable' 2022-09-15T04:02:04.9809222Z D:/rubyinstaller-head-x64/lib/ruby/gems/3.2.0+2/gems/cool.io-1.7.1/lib/cool.io/loop.rb:88:in `run_once' 2022-09-15T04:02:04.9809774Z D:/rubyinstaller-head-x64/lib/ruby/gems/3.2.0+2/gems/cool.io-1.7.1/lib/cool.io/loop.rb:88:in `run' 2022-09-15T04:02:04.9810202Z D:/a/fluentd/fluentd/lib/fluent/plugin_helper/event_loop.rb:93:in `block in start' 2022-09-15T04:02:04.9810573Z D:/a/fluentd/fluentd/lib/fluent/plugin_helper/thread.rb:78:in `block in thread_create' 2022-09-15T04:02:04.9810931Z =============================================================================== ``` Fix #3885 Signed-off-by: Takuro Ashie <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm..., it's interesting behavior. Looks good.
Just removing d.instance_shutdown
and begin
... ensure
clause prevents this race condition error, right?
That's right. |
Still one test is failed on Ruby 3.2 on Windows but it's not related to this.
|
Thanks for your review! |
Which issue(s) this PR fixes:
Fixes #3885
What this PR does / why we need it:
Fluent::Test::Driver::Base#instance_shutdown causes rase on Ruby 3.2 on Windows. I'm not sure the detailed mechanism of this issue but exiting the test driver normally doesn't cause it.
Docs Changes:
N/A
Release Note:
N/A