diff --git a/test/command/test_fluentd.rb b/test/command/test_fluentd.rb index 2ca08f5779..042c2c70db 100644 --- a/test/command/test_fluentd.rb +++ b/test/command/test_fluentd.rb @@ -230,10 +230,10 @@ def assert_fluentd_fails_to_start(cmdline, *pattern_list, timeout: 20) execute_command(cmdline) do |pid, stdout| begin waiting(timeout) do - while process_exist?(pid) && !running + until running readables, _, _ = IO.select([stdout], nil, nil, 1) next unless readables - next if readables.first.eof? + break if readables.first.eof? stdio_buf << eager_read(readables.first) lines = stdio_buf.split("\n")