diff options
-rw-r--r-- | test/ruby/test_process.rb | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/test/ruby/test_process.rb b/test/ruby/test_process.rb index eb114dbebb..28a2f05a85 100644 --- a/test/ruby/test_process.rb +++ b/test/ruby/test_process.rb @@ -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 |