From 4db63ce411de172ccf72c3534cbb9431e91b9667 Mon Sep 17 00:00:00 2001 From: Yuta Iwama Date: Thu, 31 Oct 2019 17:43:26 +0900 Subject: [PATCH] fixed failed spec Signed-off-by: Yuta Iwama --- lib/fluent/plugin/base.rb | 2 +- test/command/test_fluentd.rb | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/lib/fluent/plugin/base.rb b/lib/fluent/plugin/base.rb index a7474db007..b5c16a69e6 100644 --- a/lib/fluent/plugin/base.rb +++ b/lib/fluent/plugin/base.rb @@ -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 diff --git a/test/command/test_fluentd.rb b/test/command/test_fluentd.rb index 97bd45a00b..ee0570ac77 100644 --- a/test/command/test_fluentd.rb +++ b/test/command/test_fluentd.rb @@ -625,7 +625,8 @@ def assert_fluentd_fails_to_start(cmdline, *pattern_list, timeout: 10) workers 2 - @type single + @type dummy + tag dummy @id single @label @dummydata @@ -669,7 +670,8 @@ def write(chunk) workers 2 - @type single + @type dummy + tag dummy @id single @label @dummydata @@ -793,7 +795,7 @@ def multi_workers_ready? @id blackhole @type file - path #{File.join(@root_path, "buf", "file.*.log")} + path #{File.join(@root_path, "buf")} @@ -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