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

tests of fluent-plugin-geoip fails with fluentd v0.14.0.rc.1 #975

Closed
okkez opened this issue May 23, 2016 · 4 comments
Closed

tests of fluent-plugin-geoip fails with fluentd v0.14.0.rc.1 #975

okkez opened this issue May 23, 2016 · 4 comments
Labels
bug Something isn't working v0.14

Comments

@okkez
Copy link
Contributor

okkez commented May 23, 2016

How to reproduce

$ git clone https://github.com/y-ken/fluent-plugin-geoip.git
$ cd fluent-plugin-geoip

Append following line to Gemfile:

gem "fluentd", "= 0.14.0.rc.1"

Run tests.

$ bundle install
$ bundle exec rake

Failed a lot of tests.

...(snip)...
Error: test_emit(GeoipOutputTest): ArgumentError: wrong number of arguments (given 3, expected 2)
fluent-plugin-geoip/vendor/bundle/ruby/2.3.0/gems/fluentd-0.14.0.rc.1/lib/fluent/compat/output.rb:256:in `handle_stream_simple'
fluent-plugin-geoip/vendor/bundle/ruby/2.3.0/gems/fluentd-0.14.0.rc.1/lib/fluent/plugin/output.rb:569:in `execute_chunking'
fluent-plugin-geoip/vendor/bundle/ruby/2.3.0/gems/fluentd-0.14.0.rc.1/lib/fluent/plugin/output.rb:510:in `emit_buffered'
fluent-plugin-geoip/vendor/bundle/ruby/2.3.0/gems/fluentd-0.14.0.rc.1/lib/fluent/test/output_test.rb:46:in `emit'
fluent-plugin-geoip/test/plugin/test_out_geoip.rb:79:in `block in test_emit'
...(snip)...
Finished in 7.244726897 seconds.
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
28 tests, 21 assertions, 1 failures, 14 errors, 0 pendings, 0 omissions, 0 notifications
46.4286% passed
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
3.86 tests/s, 2.90 assertions/s

I expected that fluent-plugin-geoip tests succeeded without any changes with fluentd v0.14.0.rc.1 .

@okkez
Copy link
Contributor Author

okkez commented May 23, 2016

diff --git a/lib/fluent/compat/output.rb b/lib/fluent/compat/output.rb
index 72d28c2..4ae6f67 100644
--- a/lib/fluent/compat/output.rb
+++ b/lib/fluent/compat/output.rb
@@ -252,7 +252,7 @@ module Fluent

       # This method overrides Fluent::Plugin::Output#handle_stream_simple
       # because v0.12 BufferedOutput may overrides #format_stream, but original #handle_stream_simple method doesn't consider about it
-      def handle_stream_simple(tag, es)
+      def handle_stream_simple(tag, es, enqueue: false)
         if @overrides_format_stream
           meta = metadata(nil, nil, nil)
           bulk = format_stream(tag, es)

I added above patch in my local.
But I got another error.

Error: test_emit_with_unknown_address(GeoipOutputTest): NoMethodError: undefined method `emit_bulk' for #<Fluent::Plugin::MemoryBuffer:00000002c8d848>
fluentd/lib/fluent/compat/output.rb:266:in `handle_stream_simple'
fluentd/lib/fluent/plugin/output.rb:569:in `execute_chunking'
fluentd/lib/fluent/plugin/output.rb:510:in `emit_buffered'
fluentd/lib/fluent/test/output_test.rb:46:in `emit'
fluent-plugin-geoip/test/plugin/test_out_geoip.rb:177:in `block in test_emit_with_unknown_address'

Fluent::Plugin::MemoryBuffer#emit_bulk is removed at 1426fc1

@tagomoris
Copy link
Member

Oh, I missed to fix Fluent::Compat::BufferedOutput#handle_stream_simple

@tagomoris tagomoris changed the title [v0.14] tests of fluent-plugin-geoip fails with fluentd v0.14.0.rc.1 tests of fluent-plugin-geoip fails with fluentd v0.14.0.rc.1 May 24, 2016
@tagomoris
Copy link
Member

#988 solves this issue.

@okkez
Copy link
Contributor Author

okkez commented May 25, 2016

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working v0.14
Projects
None yet
Development

No branches or pull requests

2 participants