Commit 248385a1 authored by Boris Bügling's avatar Boris Bügling

Merge pull request #3500 from CocoaPods/delay-executable-result

Flush stdin/stderr and wait a bit in `executable`.
parents 2e117f9f 0a1eae69
...@@ -28,6 +28,10 @@ To install release candidates run `[sudo] gem install cocoapods --pre` ...@@ -28,6 +28,10 @@ To install release candidates run `[sudo] gem install cocoapods --pre`
[#3494](https://github.com/CocoaPods/CocoaPods/issues/3494) [#3494](https://github.com/CocoaPods/CocoaPods/issues/3494)
[Kyle Fuller](https://github.com/kylef) [Kyle Fuller](https://github.com/kylef)
* Flush stdin/stderr and wait a bit in `executable`.
[Boris Bügling](https://github.com/neonichu)
[#3500](https://github.com/CocoaPods/CocoaPods/issues/3500)
## 0.37.1 ## 0.37.1
......
...@@ -83,7 +83,13 @@ module Pod ...@@ -83,7 +83,13 @@ module Pod
Thread.new { while s = o.gets; stdout << s; end } Thread.new { while s = o.gets; stdout << s; end }
Thread.new { while s = e.gets; stderr << s; end } Thread.new { while s = e.gets; stderr << s; end }
i.close i.close
t.value status = t.value
o.flush
e.flush
sleep(0.1)
status
end end
end end
......
...@@ -22,10 +22,10 @@ module Pod ...@@ -22,10 +22,10 @@ module Pod
it "doesn't hang when the spawned process forks a zombie process with the same STDOUT and STDERR" do it "doesn't hang when the spawned process forks a zombie process with the same STDOUT and STDERR" do
cmd = ['-e', <<-RB] cmd = ['-e', <<-RB]
Process.fork { Process.daemon(nil, true); sleep(2) } Process.fork { Process.daemon(nil, true); sleep(4) }
puts 'out' puts 'out'
RB RB
Timeout.timeout(1) do Timeout.timeout(2) do
Executable.execute_command('ruby', cmd, true).should == "out\n" Executable.execute_command('ruby', cmd, true).should == "out\n"
end end
end end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment