Skip to content

Commit

Permalink
Fix a bug that Node doesn't have compress type
Browse files Browse the repository at this point in the history
  • Loading branch information
ganmacs committed Sep 12, 2016
1 parent 6535ef9 commit 80addd2
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/fluent/plugin/out_forward.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 9 additions & 0 deletions test/plugin/test_out_forward.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -131,6 +137,9 @@ def test_set_compress_is_gzip_in_buffer_section
])
assert_equal :text, d.instance.compress
assert_equal :gzip, d.instance.buffer.compress

node = d.instance.nodes.first
assert_equal :text, node.instance_variable_get(:@compress)
end

def test_phi_failure_detector
Expand Down

0 comments on commit 80addd2

Please sign in to comment.