summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--test/test_timeout.rb8
1 files changed, 5 insertions, 3 deletions
diff --git a/test/test_timeout.rb b/test/test_timeout.rb
index 199b18e7bc..42db4ebbbe 100644
--- a/test/test_timeout.rb
+++ b/test/test_timeout.rb
@@ -425,7 +425,9 @@ class TestTimeout < Test::Unit::TestCase
rd, wr = IO.pipe
- trap("SIGUSR1") do
+ signal = Signal.list["USR1"] ? :USR1 : :TERM
+
+ trap(signal) do
begin
Timeout.timeout(0.1) do
sleep 1
@@ -440,9 +442,9 @@ class TestTimeout < Test::Unit::TestCase
end
end
- Process.kill :USR1, Process.pid
+ Process.kill signal, Process.pid
assert_equal "OK", rd.read
rd.close
- end if Signal.list["USR1"] # Windows has no SIGUSR1
+ end
end