From 59eaf14cbf3b6529d0bc2939e42402defbc41b94 Mon Sep 17 00:00:00 2001 From: akr Date: Sun, 3 Jul 2005 09:37:49 +0000 Subject: avoid some race condition git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@8709 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_signal.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'test/ruby') diff --git a/test/ruby/test_signal.rb b/test/ruby/test_signal.rb index 2401e3211e..6ff33a29aa 100644 --- a/test/ruby/test_signal.rb +++ b/test/ruby/test_signal.rb @@ -27,12 +27,15 @@ class TestSignal < Test::Unit::TestCase def test_exit_action begin r, w = IO.pipe + r0, w0 = IO.pipe pid = fork { - r0, w0 = IO.pipe trap(:USR1, "EXIT") + w0.close + w.syswrite("a") Thread.start { Thread.pass } r0.sysread(4096) } + r.sysread(1) sleep 0.1 assert_nothing_raised("[ruby-dev:26128]") { Process.kill(:USR1, pid) @@ -48,6 +51,8 @@ class TestSignal < Test::Unit::TestCase ensure r.close w.close + r0.close + w0.close end end end -- cgit v1.2.3