mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
test/ruby/test_process.rb: get rid of timing issue
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61476 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
65d3461e95
commit
67fd07738d
1 changed files with 6 additions and 3 deletions
|
@ -676,14 +676,17 @@ class TestProcess < Test::Unit::TestCase
|
|||
return
|
||||
end
|
||||
IO.popen([RUBY, '-e', <<-'EOS']) {|io|
|
||||
STDOUT.sync = true
|
||||
trap(:USR1) { print "trap\n" }
|
||||
puts "start"
|
||||
system("cat", :in => "fifo")
|
||||
EOS
|
||||
sleep 1
|
||||
assert_equal("start\n", io.gets)
|
||||
sleep 0.2 # wait for the child to stop at opening "fifo"
|
||||
Process.kill(:USR1, io.pid)
|
||||
sleep 1
|
||||
assert_equal("trap\n", io.readpartial(8))
|
||||
File.write("fifo", "ok\n")
|
||||
assert_equal("trap\nok\n", io.read)
|
||||
assert_equal("ok\n", io.read)
|
||||
}
|
||||
}
|
||||
end unless windows? # does not support fifo
|
||||
|
|
Loading…
Reference in a new issue