Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GitHub Actions: Add macOS and remove .travis.yml #3290

Merged
merged 4 commits into from
Mar 10, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Make sure to start I/O loop of a test on macOS
Fix the following failure:

Failure: test: can execute external command just once, and can terminate it forcedly when shutdown/terminate even if it ignore SIGTERM(ChildProcessTest):
        assert { lines2 > lines1 }
                 |      | |
                 |      | 0
                 |      false
                 0
/Users/runner/work/fluentd/fluentd/test/plugin_helper/test_child_process.rb:301:in `block (2 levels) in <class:ChildProcessTest>'
     298:       @d.shutdown
     299:       sleep TEST_WAIT_INTERVAL_FOR_LOOP
     300:       lines2 = ary.size
  => 301:       assert { lines2 > lines1 }
     302:       @d.close
     303:
     304:       assert_nil((Process.waitpid(pid, Process::WNOHANG) rescue nil))

Signed-off-by: Takuro Ashie <ashie@clear-code.com>
  • Loading branch information
ashie committed Mar 9, 2021
commit 51d6b9e36110d475ba276514cb61cd7529fc44c5
7 changes: 5 additions & 2 deletions test/plugin_helper/test_child_process.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# coding: utf-8
require_relative '../helper'
require 'fluent/plugin_helper/child_process'
require 'fluent/plugin/base'
Expand Down Expand Up @@ -269,10 +270,12 @@ def configure(conf)
Timeout.timeout(TEST_DEADLOCK_TIMEOUT) do
ran = false
@d.child_process_execute(:t4, "ruby -e 'Signal.trap(:TERM, nil); while sleep 0.1; puts 1; STDOUT.flush rescue nil; end'", mode: [:read]) do |io|
m.lock
ran = true
begin
while line = io.readline
unless ran
m.lock
ran = true
end
ary << line
end
rescue
Expand Down