diff options
author | sorah <sorah@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-03-11 08:28:48 +0000 |
---|---|---|
committer | sorah <sorah@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-03-11 08:28:48 +0000 |
commit | 42b1df08fc39bd990c0dd3c97e2689a085f9ce14 (patch) | |
tree | bb4114dc8898e6cdd4a6b9af48ee6acfcfd5c65f /lib/test/unit | |
parent | 605f4baef74582341397b02bc3ac00eddeaf4581 (diff) |
* lib/test/unit.rb: Put error message into STDERR if failed to lanch
worker (job) process. [ruby-dev:44802] [Bug #5577]
* lib/test/unit/parallel.rb: If failed to increment_io, exit with code
2. [ruby-dev:44802] [Bug #5577]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34968 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/test/unit')
-rw-r--r-- | lib/test/unit/parallel.rb | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/lib/test/unit/parallel.rb b/lib/test/unit/parallel.rb index 049b470e40..522447c63b 100644 --- a/lib/test/unit/parallel.rb +++ b/lib/test/unit/parallel.rb @@ -88,8 +88,14 @@ module Test @old_loadpath = [] begin - @stdout = increment_io(STDOUT) - @stdin = increment_io(STDIN) + begin + @stdout = increment_io(STDOUT) + @stdin = increment_io(STDIN) + rescue + exit 2 + end + exit 2 unless @stdout && @stdin + @stdout.sync = true @stdout.puts "ready!" while buf = @stdin.gets @@ -130,12 +136,12 @@ module Test rescue Errno::EPIPE rescue Exception => e begin - @stdout.puts "bye #{[Marshal.dump(e)].pack("m0")}" + @stdout.puts "bye #{[Marshal.dump(e)].pack("m0")}" if @stdout rescue Errno::EPIPE;end exit ensure - @stdin.close - @stdout.close + @stdin.close if @stdin + @stdout.close if @stdout end end end |