Skip to content
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

CI: Support Fluentd after v1.13.3 #6

Closed
daipom opened this issue Feb 17, 2023 · 5 comments · Fixed by #8
Closed

CI: Support Fluentd after v1.13.3 #6

daipom opened this issue Feb 17, 2023 · 5 comments · Fixed by #8
Assignees

Comments

@daipom
Copy link
Contributor

daipom commented Feb 17, 2023

The CI is updated in #5, but Bundler is still choosing Fluentd v1.12, not the latest Fluentd v1.15.3.

https://github.com/fluent-plugins-nursery/fluent-plugin-utmpx/actions/runs/4201345210/jobs/7288262037#step:3:69

It is the same in my local with Ruby 3.2.0.

Some tests fail on Fluentd v1.15.3.
($ bundle exec rake test is successful, but just $ rake test is not)

.......E
==================================================================================================================================================================================================================================================================================
Error: test_pos_file(UtmpxInputTest::pos_file use cases): ArgumentError: wrong number of arguments (given 3, expected 2)
/home/daipom/.rbenv/versions/3.2.0/lib/ruby/gems/3.2.0/gems/fluentd-1.15.3/lib/fluent/plugin/in_tail/position_file.rb:31:in `initialize'
/home/daipom/work/fluentd/plugins/embedded-in-td-agent/fluent-plugin-utmpx/test/plugin/test_in_utmpx.rb:93:in `new'
/home/daipom/work/fluentd/plugins/embedded-in-td-agent/fluent-plugin-utmpx/test/plugin/test_in_utmpx.rb:93:in `block in test_pos_file'
     90:           @pf = Fluent::Plugin::TailInput::PositionFile.new(file, logger: nil)
     91:           @pe = @pf[wtmp_path]
     92:         else
  => 93:           @pf = Fluent::Plugin::TailInput::PositionFile.new(file, false, {wtmp_path => target_info}, logger: nil)
     94:           @pe = @pf[target_info]
     95:         end
     96:         @pe.update_pos(@tail_position)
/home/daipom/work/fluentd/plugins/embedded-in-td-agent/fluent-plugin-utmpx/test/plugin/test_in_utmpx.rb:87:in `open'
/home/daipom/work/fluentd/plugins/embedded-in-td-agent/fluent-plugin-utmpx/test/plugin/test_in_utmpx.rb:87:in `test_pos_file'
==================================================================================================================================================================================================================================================================================
E
==================================================================================================================================================================================================================================================================================
Error: test_truncated(UtmpxInputTest::pos_file use cases): ArgumentError: wrong number of arguments (given 3, expected 2)
/home/daipom/.rbenv/versions/3.2.0/lib/ruby/gems/3.2.0/gems/fluentd-1.15.3/lib/fluent/plugin/in_tail/position_file.rb:31:in `initialize'
/home/daipom/work/fluentd/plugins/embedded-in-td-agent/fluent-plugin-utmpx/test/plugin/test_in_utmpx.rb:117:in `new'
/home/daipom/work/fluentd/plugins/embedded-in-td-agent/fluent-plugin-utmpx/test/plugin/test_in_utmpx.rb:117:in `block in test_truncated'
     114:           @pf = Fluent::Plugin::TailInput::PositionFile.new(file, logger: nil)
     115:           @pe = @pf[wtmp_path]
     116:         else
  => 117:           @pf = Fluent::Plugin::TailInput::PositionFile.new(file, false, {wtmp_path => target_info}, logger: nil)
     118:           @pe = @pf[target_info]
     119:         end
     120:         @pe.update_pos(@tail_position)
/home/daipom/work/fluentd/plugins/embedded-in-td-agent/fluent-plugin-utmpx/test/plugin/test_in_utmpx.rb:111:in `open'
/home/daipom/work/fluentd/plugins/embedded-in-td-agent/fluent-plugin-utmpx/test/plugin/test_in_utmpx.rb:111:in `test_truncated'
==================================================================================================================================================================================================================================================================================

Finished in 31.615735198 seconds.
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
9 tests, 10 assertions, 0 failures, 2 errors, 0 pendings, 0 omissions, 0 notifications
77.7778% passed
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
0.28 tests/s, 0.32 assertions/s
rake aborted!
@daipom daipom self-assigned this Feb 17, 2023
@daipom
Copy link
Contributor Author

daipom commented Feb 17, 2023

Hmm, I'm investigating why Bundler chooses Fluentd v1.12.

spec.add_runtime_dependency "linux-utmpx", "~> 0.3.0"
spec.add_runtime_dependency "fluentd", [">= 0.14.10", "< 2"]
spec.add_development_dependency "bundler"
spec.add_development_dependency "rake"
spec.add_development_dependency "test-unit", "~> 3.5"
spec.add_development_dependency "webrick"

@daipom
Copy link
Contributor Author

daipom commented Feb 17, 2023

Somehow this line affects the fluentd's version chosen by Bundler.

spec.add_development_dependency "webrick"

@daipom
Copy link
Contributor Author

daipom commented Feb 17, 2023

Somehow this line affects the fluentd's version chosen by Bundler.

spec.add_development_dependency "webrick"

This is because Fluentd limits the version of "webrick".

https://github.com/fluent/fluentd/blob/34f2c559e41aa7f4b760f55c9ac60a124de4c139/fluentd.gemspec#L31

@daipom
Copy link
Contributor Author

daipom commented Feb 17, 2023

The signature of Fluent::Plugin::TailInput::PositionFile.new() had changed since v1.13.3.

We need to follow this change.

@daipom daipom changed the title Support Fluentd v1.15.3 Support Fluentd after v1.13.3 Feb 17, 2023
@daipom daipom changed the title Support Fluentd after v1.13.3 CI: Support Fluentd after v1.13.3 Feb 17, 2023
@daipom
Copy link
Contributor Author

daipom commented Feb 17, 2023

This looks like simply a test issue.

The main code uses PositionFile.load instead of new().

if Gem::Version.new(Fluent::VERSION) < Gem::Version.new("1.12.0")
@pf = TailInput::PositionFile.load(@pf_file, logger: log)
else
@pf = TailInput::PositionFile.load(@pf_file, false, {target_info.path => target_info}, logger: log)
end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant