summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-07-03 09:37:49 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-07-03 09:37:49 +0000
commit213a84e4de39987f6626cafd59886391ec7a90f8 (patch)
treed8b37bab791f40276dea2d899403875522607141
parent34c60855c25c62a8990fa9cbe42c74abc92b1b52 (diff)
downloadruby-213a84e4de39987f6626cafd59886391ec7a90f8.tar.gz
ruby-213a84e4de39987f6626cafd59886391ec7a90f8.tar.xz
ruby-213a84e4de39987f6626cafd59886391ec7a90f8.zip
avoid some race condition
git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8@8709 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--test/ruby/test_signal.rb7
1 files changed, 6 insertions, 1 deletions
diff --git a/test/ruby/test_signal.rb b/test/ruby/test_signal.rb
index 2401e3211..6ff33a29a 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