fluentd icon indicating copy to clipboard operation
fluentd copied to clipboard

CI: Fail on Ruby 3.2 preview2 on Windows

Open ashie opened this issue 1 year ago • 2 comments

Describe the bug

CI fails with ruby 3.2.0dev (2022-08-22 master 9f3140a42e) [x64-mingw-ucrt] on Windows: https://github.com/fluent/fluentd/runs/7945647354?check_suite_focus=true

It succeeded with ruby 3.2.0dev (2022-08-19 master 35c794b26d) [x64-mingw-ucrt] on Windows though: https://github.com/fluent/fluentd/runs/7913475855?check_suite_focus=true

To Reproduce

Run CI with ruby 3.2.0dev (2022-08-22 master 9f3140a42e) [x64-mingw-ucrt] on Windows

Expected behavior

The test should succeed.

Your Environment

- Fluentd version: 1.15.2
- TD Agent version:
- Operating system: Windows
- Kernel version:

Your Configuration

Changes in Ruby: https://github.com/ruby/ruby/compare/35c794b..9f3140a

Your Error Log

2022-08-22T06:26:48.0261596Z   keepalive: 
2022-08-22T06:26:48.7718954Z     test: Do not create connection per send_data:	.: (0.745608)
2022-08-22T06:26:49.0457212Z     test: create timer of purging obsolete sockets:	.: (0.273691)
2022-08-22T06:26:49.0458376Z     with require_ack_response: 
2022-08-22T06:26:49.8032564Z #<Thread:0x000001febc53fe78@event_loop D:/a/fluentd/fluentd/lib/fluent/plugin_helper/thread.rb:70 run> terminated with exception (report_on_exception is true):
2022-08-22T06:26:49.8044023Z 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-08-22T06:26:49.8044554Z 
2022-08-22T06:26:49.8044905Z       @_read_watcher.attach(loop)
2022-08-22T06:26:49.8045358Z                             ^^^^
2022-08-22T06:26:49.8047633Z 	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-08-22T06:26:49.8052740Z 	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-08-22T06:26:49.8053208Z 	from (eval):7:in `attach'
2022-08-22T06:26:49.8053789Z 	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-08-22T06:26:49.8054504Z 	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-08-22T06:26:49.8055191Z 	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-08-22T06:26:49.8055848Z 	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-08-22T06:26:49.8056338Z 	from D:/a/fluentd/fluentd/lib/fluent/plugin_helper/event_loop.rb:93:in `block in start'
2022-08-22T06:26:49.8056825Z 	from D:/a/fluentd/fluentd/lib/fluent/plugin_helper/thread.rb:78:in `block in thread_create'
2022-08-22T06:26:50.2666186Z       test: Create connection per send_data:		E
2022-08-22T06:26:50.2666978Z ===============================================================================
2022-08-22T06:26:50.2670563Z 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-08-22T06:26:50.2672222Z 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-08-22T06:26:50.2673551Z 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-08-22T06:26:50.2675050Z 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-08-22T06:26:50.2675808Z (eval):7:in `attach'
2022-08-22T06:26:50.2676773Z 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-08-22T06:26:50.2677918Z 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-08-22T06:26:50.2679011Z 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-08-22T06:26:50.2680245Z 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-08-22T06:26:50.2681169Z D:/a/fluentd/fluentd/lib/fluent/plugin_helper/event_loop.rb:93:in `block in start'
2022-08-22T06:26:50.2682012Z D:/a/fluentd/fluentd/lib/fluent/plugin_helper/thread.rb:78:in `block in thread_create'


### Additional context

_No response_

ashie avatar Aug 22 '22 09:08 ashie

On latest version of Ruby, error tests are increased to more than 100.

https://github.com/fluent/fluentd/runs/8061680028?check_suite_focus=true

2022-08-29T00:26:12.2121065Z [command]D:\rubyinstaller-head-x64\bin\ruby.exe --version
2022-08-29T00:26:12.2310423Z ruby 3.2.0dev (2022-08-29 master 5fcce23ae2) [x64-mingw-ucrt]
2022-08-29T00:50:01.9189975Z -------------------------------------------------------------------------------
2022-08-29T00:50:01.9190646Z 3768 tests, 12942 assertions, 0 failures, 118 errors, 0 pendings, 50 omissions, 0 notifications
2022-08-29T00:50:01.9191096Z 97.6062% passed
2022-08-29T00:50:01.9195298Z -------------------------------------------------------------------------------

Probably most of new errors are caused by same root cause:

e.g.)

2022-08-29T00:35:22.5828727Z ===============================================================================
2022-08-29T00:35:22.5835214Z Error: test: creates lock directory when with_lock is true to exclude operations of other worker process(FileOutputTest::#find_filepath_available): Errno::EACCES: Permission denied @ apply2files - D:/a/fluentd/fluentd/test/tmp/out_file/find_filepath_test/exist_0.log
2022-08-29T00:35:22.5836627Z D:/rubyinstaller-head-x64/lib/ruby/3.2.0+2/fileutils.rb:2300:in `unlink'
2022-08-29T00:35:22.5837361Z D:/rubyinstaller-head-x64/lib/ruby/3.2.0+2/fileutils.rb:2300:in `block in remove_file'
2022-08-29T00:35:22.5838037Z D:/rubyinstaller-head-x64/lib/ruby/3.2.0+2/fileutils.rb:2308:in `platform_support'
2022-08-29T00:35:22.5838710Z D:/rubyinstaller-head-x64/lib/ruby/3.2.0+2/fileutils.rb:2299:in `remove_file'
2022-08-29T00:35:22.5839349Z D:/rubyinstaller-head-x64/lib/ruby/3.2.0+2/fileutils.rb:2288:in `remove'
2022-08-29T00:35:22.5840005Z D:/rubyinstaller-head-x64/lib/ruby/3.2.0+2/fileutils.rb:1425:in `block in remove_entry'
2022-08-29T00:35:22.5840690Z D:/rubyinstaller-head-x64/lib/ruby/3.2.0+2/fileutils.rb:2347:in `block (2 levels) in postorder_traverse'
2022-08-29T00:35:22.5841376Z D:/rubyinstaller-head-x64/lib/ruby/3.2.0+2/fileutils.rb:2351:in `postorder_traverse'
2022-08-29T00:35:22.5842071Z D:/rubyinstaller-head-x64/lib/ruby/3.2.0+2/fileutils.rb:2346:in `block in postorder_traverse'
2022-08-29T00:35:22.5842727Z D:/rubyinstaller-head-x64/lib/ruby/3.2.0+2/fileutils.rb:2345:in `each'
2022-08-29T00:35:22.5843336Z D:/rubyinstaller-head-x64/lib/ruby/3.2.0+2/fileutils.rb:2345:in `postorder_traverse'
2022-08-29T00:35:22.5844001Z D:/rubyinstaller-head-x64/lib/ruby/3.2.0+2/fileutils.rb:1423:in `remove_entry'
2022-08-29T00:35:22.5844660Z D:/rubyinstaller-head-x64/lib/ruby/3.2.0+2/fileutils.rb:1276:in `block in rm_r'
2022-08-29T00:35:22.5845269Z D:/rubyinstaller-head-x64/lib/ruby/3.2.0+2/fileutils.rb:1272:in `each'
2022-08-29T00:35:22.5845847Z D:/rubyinstaller-head-x64/lib/ruby/3.2.0+2/fileutils.rb:1272:in `rm_r'
2022-08-29T00:35:22.5846470Z D:/rubyinstaller-head-x64/lib/ruby/3.2.0+2/fileutils.rb:1300:in `rm_rf'
2022-08-29T00:35:22.5847056Z D:/a/fluentd/fluentd/test/plugin/test_out_file.rb:993:in `block (2 levels) in <class:FileOutputTest>'
2022-08-29T00:35:22.5847573Z ===============================================================================

ashie avatar Aug 29 '22 02:08 ashie

On latest version of Ruby, error tests are increased to more than 100.

2022-08-29T00:35:22.5828727Z ===============================================================================
2022-08-29T00:35:22.5835214Z Error: test: creates lock directory when with_lock is true to exclude operations of other worker process(FileOutputTest::#find_filepath_available): Errno::EACCES: Permission denied @ apply2files - D:/a/fluentd/fluentd/test/tmp/out_file/find_filepath_test/exist_0.log

This is because FileUtils.rm_rf in Ruby 3.2 doesn't ignore Errno::EACCES anymore, only Errno::ENOENT is swallowed: https://github.com/ruby/ruby/commit/983115cf3c8f75b1afbe3274f02c1529e1ce3a81

On windows, probably delete pending state causes this error.

ashie avatar Sep 01 '22 05:09 ashie