Skip to content

Commit

Permalink
fixed failed spec
Browse files Browse the repository at this point in the history
Signed-off-by: Yuta Iwama <[email protected]>
  • Loading branch information
ganmacs committed Oct 31, 2019
1 parent 98e3034 commit 4db63ce
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lib/fluent/plugin/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def fluentd_worker_id
end

def configure(conf)
if conf.respond_to?(:for_this_worker?) && conf.for_this_worker?
if Fluent::Engine.supervisor_mode || (conf.respond_to?(:for_this_worker?) && conf.for_this_worker?)
workers = if conf.target_worker_ids && !conf.target_worker_ids.empty?
conf.target_worker_ids.size
else
Expand Down
9 changes: 6 additions & 3 deletions test/command/test_fluentd.rb
Original file line number Diff line number Diff line change
Expand Up @@ -625,7 +625,8 @@ def assert_fluentd_fails_to_start(cmdline, *pattern_list, timeout: 10)
workers 2
</system>
<source>
@type single
@type dummy
tag dummy
@id single
@label @dummydata
</source>
Expand Down Expand Up @@ -669,7 +670,8 @@ def write(chunk)
workers 2
</system>
<source>
@type single
@type dummy
tag dummy
@id single
@label @dummydata
</source>
Expand Down Expand Up @@ -793,7 +795,7 @@ def multi_workers_ready?
@id blackhole
<buffer>
@type file
path #{File.join(@root_path, "buf", "file.*.log")}
path #{File.join(@root_path, "buf")}
</buffer>
</match>
</worker>
Expand Down Expand Up @@ -863,6 +865,7 @@ module Fluent::Plugin
class FakeInput < Input
Fluent::Plugin.register_input('fake', self)
config_param :secret, :string, secret: true
def multi_workers_ready?; true; end
end
end
EOC
Expand Down

0 comments on commit 4db63ce

Please sign in to comment.