summaryrefslogtreecommitdiff
path: root/tool/test-bundled-gems.rb
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2022-07-24 16:35:38 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2022-07-24 16:36:33 +0900
commite0a7e5e13141a06103673b9d4ff21ca864ec38f9 (patch)
treee26fffdbaea56eacd314c438fdd82144bf4e9f8a /tool/test-bundled-gems.rb
parent114f85ecec5ad34531b77c0248f4a3bf070404d1 (diff)
downloadruby-e0a7e5e13141a06103673b9d4ff21ca864ec38f9.tar.gz
Kill bundled gem tests when interrupted
Diffstat (limited to 'tool/test-bundled-gems.rb')
-rw-r--r--tool/test-bundled-gems.rb12
1 files changed, 10 insertions, 2 deletions
diff --git a/tool/test-bundled-gems.rb b/tool/test-bundled-gems.rb
index 6312e1872d..1bdf2fa95a 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