From f1ed8a8e7d309460327bf64fa86244793a947380 Mon Sep 17 00:00:00 2001 From: ganmacs Date: Mon, 12 Sep 2016 17:45:41 +0900 Subject: [PATCH] Fix a bug that `Node` doesn't have compress type --- lib/fluent/plugin/out_forward.rb | 1 + test/plugin/test_out_forward.rb | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/lib/fluent/plugin/out_forward.rb b/lib/fluent/plugin/out_forward.rb index acb4712256..ccec0aab0e 100644 --- a/lib/fluent/plugin/out_forward.rb +++ b/lib/fluent/plugin/out_forward.rb @@ -340,6 +340,7 @@ class Node def initialize(sender, server, failure:) @sender = sender @log = sender.log + @compress = sender.compress @name = server.name @host = server.host diff --git a/test/plugin/test_out_forward.rb b/test/plugin/test_out_forward.rb index 1af4de0779..8585c7a687 100644 --- a/test/plugin/test_out_forward.rb +++ b/test/plugin/test_out_forward.rb @@ -111,12 +111,18 @@ def test_configure_no_server def test_compress_default_value d = create_driver assert_equal :text, d.instance.compress + + node = d.instance.nodes.first + assert_equal :text, node.instance_variable_get(:@compress) end def test_set_compress_is_gzip d = create_driver(CONFIG + %[compress gzip]) assert_equal :gzip, d.instance.compress assert_equal :gzip, d.instance.buffer.compress + + node = d.instance.nodes.first + assert_equal :gzip, node.instance_variable_get(:@compress) end def test_set_compress_is_gzip_in_buffer_section