From 01fb7e5b71db72522ba26fde0c2f7fd2d194077f Mon Sep 17 00:00:00 2001 From: nobu Date: Tue, 26 Jul 2016 16:22:56 +0000 Subject: dtrace: wait command * test/dtrace/helper.rb (DTrace::TestCase::READ_PROBES): wait the spawned command not to make a waiter thread. fix up r55736. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55762 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/dtrace/helper.rb | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/test/dtrace/helper.rb b/test/dtrace/helper.rb index 1417185537..539cce9d6f 100644 --- a/test/dtrace/helper.rb +++ b/test/dtrace/helper.rb @@ -31,9 +31,12 @@ module DTrace DTRACE_CMD = %w[dtrace -b 8m] when /darwin/i READ_PROBES = proc do |cmd| - PTY.spawn(*cmd) do |io, _| - break io.readlines.each {|line| line.sub!(/\r$/, "")} + lines = nil + PTY.spawn(*cmd) do |io, _, pid| + lines = io.readlines.each {|line| line.sub!(/\r$/, "")} + Process.wait(pid) end + lines end end -- cgit v1.2.3