Skip to content

Commit

Permalink
TEST: Don't use SIGTERM on Windows
Browse files Browse the repository at this point in the history
On Windows, unnecessary timeout always occurred.
This fix reduce the test time of `TestFluentdCommand`.

Signed-off-by: Daijiro Fukuda <fukuda@clear-code.com>
  • Loading branch information
daipom committed Feb 18, 2023
1 parent 07e3ad1 commit a8659e8
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions test/command/test_fluentd.rb
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,11 @@ def create_cmdline(conf_path, *fluentd_options)
end

def process_kill(pid)
if Fluent.windows?
Process.kill(:KILL, pid) rescue nil
return
end

begin
Process.kill(:TERM, pid) rescue nil
Timeout.timeout(10){ sleep 0.1 while process_exist?(pid) }
Expand Down

0 comments on commit a8659e8

Please sign in to comment.