fluentd: Some unit tests are broken on Ruby 3.0
Check CONTRIBUTING guideline first and here is the list to help us investigate the problem.
Describe the bug
Drone CI is continuously broken for two months. See https://cloud.drone.io/fluent/fluentd
To Reproduce
Follow steps in .drone.yml
See https://github.com/fluent/fluentd/blob/master/.drone.yml#L26-L35
Expected behavior
There are 3 test case failures.
===============================================================================
Failure: test: it does not create accessor methods for parameters(Fluent::Config::TestConfigurable:::skip_accessor option)
/drone/src/test/config/test_configurable.rb:1456:in `block (2 levels) in <class:TestConfigurable>'
1453: @example = ConfigurableSpec::ExampleWithSkipAccessor.new
1454: @example.configure(config_element('ROOT'))
1455: assert_equal 'example7', @example.instance_variable_get(:@name)
=> 1456: assert_raise NoMethodError.new("undefined method `name' for #{@example}") do
1457: @example.name
1458: end
1459: end
===============================================================================
Failure: test: when out_forward has @id(ForwardOutputTest):
Exception raised:
ArgumentError(<wrong number of arguments (given 2, expected 1)>)
/drone/src/lib/fluent/plugin.rb:120:in `new_sd'
/drone/src/vendor/bundle/ruby/3.0.0/gems/rr-1.2.1/lib/rr/method_dispatches/method_dispatch.rb:30:in `call_original_method'
/drone/src/vendor/bundle/ruby/3.0.0/gems/rr-1.2.1/lib/rr/method_dispatches/method_dispatch.rb:41:in `call_implementation'
/drone/src/vendor/bundle/ruby/3.0.0/gems/rr-1.2.1/lib/rr/method_dispatches/method_dispatch.rb:16:in `call'
/drone/src/vendor/bundle/ruby/3.0.0/gems/rr-1.2.1/lib/rr/injections/double_injection.rb:183:in `dispatch_method'
/drone/src/vendor/bundle/ruby/3.0.0/gems/rr-1.2.1/lib/rr/injections/double_injection.rb:40:in `dispatch_method'
/drone/src/vendor/bundle/ruby/3.0.0/gems/rr-1.2.1/lib/rr/injections/double_injection.rb:148:in `new_sd'
/drone/src/lib/fluent/plugin_helper/service_discovery/manager.rb:37:in `block in configure'
===============================================================================
Failure: test: Do not create connection per send_data(ForwardOutputTest::keepalive):
socket_create_tcp("127.0.0.1", 38557, anything)
Called 2 times.
Expected 1 times.
/drone/src/test/plugin/test_out_forward.rb:1188:in `block (2 levels) in <class:ForwardOutputTest>'
1185:
1186: begin
1187: chunk = Fluent::Plugin::Buffer::MemoryChunk.new(Fluent::Plugin::Buffer::Metadata.new(nil, nil, nil))
=> 1188: mock.proxy(d.instance).socket_create_tcp(TARGET_HOST, TARGET_PORT, anything) { |sock| mock(sock).close.once; sock }.once
1189:
1190: target_input_driver.run(timeout: 15) do
1191: d.run(shutdown: false) do
===============================================================================
Your Environment
- Fluentd or td-agent version:
fluentd --version
ortd-agent --version
- Operating system:
cat /etc/os-release
- Kernel version:
uname -r
$ ruby -v
ruby 3.0.0p0 (2020-12-25 revision 95aff21468) [aarch64-linux]
$ bundle exec gem list
*** LOCAL GEMS ***
async (1.28.9)
async-http (0.54.1)
async-io (1.30.2)
async-pool (0.3.5)
bundler (2.2.11)
concurrent-ruby (1.1.8)
console (1.10.1)
cool.io (1.7.1)
docile (1.3.5)
fiber-local (1.0.0)
flexmock (2.3.6)
fluentd (1.12.1)
http_parser.rb (0.6.0)
msgpack (1.4.2)
nio4r (2.5.5)
oj (3.11.2)
parallel (1.20.1)
parallel_tests (0.15.4)
power_assert (2.0.0)
protocol-hpack (1.4.2)
protocol-http (0.21.0)
protocol-http1 (0.13.2)
protocol-http2 (0.14.2)
rake (13.0.3)
rr (1.2.1)
serverengine (2.2.3)
sigdump (0.2.4)
simplecov (0.21.2)
simplecov-html (0.12.3)
simplecov_json_formatter (0.1.2)
strptime (0.2.5)
test-unit (3.4.0)
test-unit-rr (1.0.5)
timecop (0.9.4)
timers (4.3.3)
tzinfo (2.0.4)
tzinfo-data (1.2021.1)
yajl-ruby (1.4.1)
Your Configuration
N/A
Your Error Log
I’ve attached logs
Additional context
N/A arm64v8-test.log
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 27 (27 by maintainers)
Fix for ServerEngine: https://github.com/treasure-data/serverengine/pull/112
As #3316 was merged, the rest of TODO: fiddle related one.