diff options
author | nagachika <nagachika@ruby-lang.org> | 2022-10-21 14:16:19 +0900 |
---|---|---|
committer | nagachika <nagachika@ruby-lang.org> | 2022-10-21 14:16:19 +0900 |
commit | eb815dfd9788c85251c7385dd09f9fab35e7e1b9 (patch) | |
tree | 2138dd8aee972aedbc505137477722c357a3b345 /tool | |
parent | 3914581213e3aea138b02941b41e62c15461af27 (diff) |
merge revision(s) e0a7e5e13141a06103673b9d4ff21ca864ec38f9:
Kill bundled gem tests when interrupted
---
common.mk | 2 +-
tool/test-bundled-gems.rb | 12 ++++++++++--
2 files changed, 11 insertions(+), 3 deletions(-)
Diffstat (limited to 'tool')
-rw-r--r-- | tool/test-bundled-gems.rb | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/tool/test-bundled-gems.rb b/tool/test-bundled-gems.rb index 4fcc787dc6..e349ce8110 100644 --- a/tool/test-bundled-gems.rb +++ b/tool/test-bundled-gems.rb @@ -71,15 +71,23 @@ File.foreach("#{gem_dir}/bundled_gems") do |line| break Timeout.timeout(sec) {Process.wait(pid)} rescue Timeout::Error end + rescue Interrupt + exit_code = Signal.list["INT"] + Process.kill("-KILL", pid) + Process.wait(pid) + break end unless $?.success? - puts "Tests failed with exit code #{$?.exitstatus}" + + puts "Tests failed " + + ($?.signaled? ? "by SIG#{Signal.signame($?.termsig)}" : + "with exit code #{$?.exitstatus}") if allowed_failures.include?(gem) puts "Ignoring test failures for #{gem} due to \$TEST_BUNDLED_GEMS_ALLOW_FAILURES" else failed << gem - exit_code = $?.exitstatus + exit_code = $?.exitstatus if $?.exitstatus end end print "##[endgroup]\n" if github_actions |