Permalink
Browse files

Flush output before stopping so processes that have buffered their ou…

…tput will exit gracefully
  • Loading branch information...
1 parent 5908786 commit e560605ee9fee19ad69478590ff6e5da69c89ebe @msassak msassak committed Nov 16, 2010
Showing with 3 additions and 1 deletion.
  1. +2 −1 features/flushing.feature
  2. +1 −0 lib/aruba/process.rb
@@ -14,10 +14,11 @@ Feature: Flushing output
When I run "ruby -e 'puts :a.to_s * 65536'"
Then the output should contain "a"
And the output should be 65536 bytes long
- # And the exit status should be 0
+ And the exit status should be 0
Scenario: Tons of interactive output
When I run "ruby -e 'len = gets.chomp; puts :a.to_s * len.to_i'" interactively
And I type "65536"
Then the output should contain "a"
And the output should be 65536 bytes long
+ # And the exit status should be 0
View
@@ -38,6 +38,7 @@ def stderr
def stop
if @process
+ stdout && stderr # flush output
status = @process.wait(@timeout)
status && status.exitstatus
end

0 comments on commit e560605

Please sign in to comment.