Skip to content

Commit

Permalink
debug
Browse files Browse the repository at this point in the history
Signed-off-by: Yuta Iwama <ganmacs@gmail.com>
  • Loading branch information
ganmacs committed Jan 31, 2020
1 parent 30483f8 commit 5cdc95a
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
3 changes: 2 additions & 1 deletion Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ Rake::TestTask.new(:base_test) do |t|
t.test_files = if ENV["WIN_RAPID"]
["test/test_event.rb", "test/test_supervisor.rb", "test/plugin_helper/test_event_loop.rb"]
else
tests = Dir["test/**/test_*.rb"].sort
# tests = Dir["test/**/test_*.rb"].sort
tests = Dir["test/command/test_fluentd.rb"].sort
if Process.uid.zero?
puts "test_file_util.rb for non-root user env. Disable this test on root environment"
tests.delete("test/plugin/test_file_util.rb")
Expand Down
4 changes: 4 additions & 0 deletions lib/fluent/supervisor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -668,6 +668,10 @@ def supervise
fluentd_spawn_cmd += $fluentdargv
fluentd_spawn_cmd << "--under-supervisor"

puts nil, '<============================================================ OUTPUT START HERE'
p fluentd_spawn_cmd
puts '<============================================================ OUTPUT CLOSE HERE', nil

$log.info "spawn command to main: ", cmdline: fluentd_spawn_cmd

params = {
Expand Down
11 changes: 9 additions & 2 deletions test/command/test_fluentd.rb
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,10 @@ def execute_command(cmdline, chdir=TMP_DIR, env = {})
null_stream = File.open(File::NULL, 'w')
gemfile_path = File.expand_path(File.dirname(__FILE__) + "../../../Gemfile")

env = { "BUNDLE_GEMFILE" => gemfile_path }.merge(env)
env.merge!({ "BUNDLE_GEMFILE" => gemfile_path })
cmdname = cmdline.shift
arg0 = "testing-fluentd"
# p(here: "executing process", env: env, cmdname: cmdname, arg0: arg0, args: cmdline)
p(here: "executing process", env: env, cmdname: cmdname, arg0: arg0, args: cmdline)
IO.popen(env, [[cmdname, arg0], *cmdline], chdir: chdir, err: [:child, :out]) do |io|
pid = io.pid
begin
Expand Down Expand Up @@ -116,6 +116,10 @@ def assert_log_matches(cmdline, *pattern_list, patterns_not_match: [], timeout:
assert_error_msg = "unexpected error in launching fluentd: #{e.inspect}\n" + stdio_buf
end

puts nil, '<============================================================ OUTPUT START HERE'
p stdio_buf
puts '<============================================================ OUTPUT CLOSE HERE', nil

if matched
assert matched, assert_error_msg
else
Expand Down Expand Up @@ -784,6 +788,9 @@ def multi_workers_ready?
end

test "multiple values are set to RUBYOPT" do
require 'logger'
lo = ServerEngine::DaemonLogger.new(STDOUT, log_level: ServerEngine::DaemonLogger::INFO)
$log = Fluent::Log.new(lo)
conf = <<CONF
<source>
@type dummy
Expand Down

0 comments on commit 5cdc95a

Please sign in to comment.