diff --git a/lib/runner/job.rb b/lib/runner/job.rb index 8b3def8..d66a226 100644 --- a/lib/runner/job.rb +++ b/lib/runner/job.rb @@ -9,6 +9,7 @@ class Job def initialize(runner, id, build_id, project, root, type, ruby_interpreter, files) @runner, @id, @build_id, @project, @root, @type, @ruby_interpreter, @files = runner, id, build_id, project, root, type, ruby_interpreter, files + @success = true end def jruby? @@ -84,7 +85,8 @@ def spawn_process(command) @pid = POSIX::Spawn::spawn(command, :err => write_pipe, :out => write_pipe, :pgroup => true) Thread.new do - Process.wait(@pid) + Process.waitpid(@pid) + @success = ($?.exitstatus == 0) write_pipe.close end @@ -92,7 +94,7 @@ def spawn_process(command) end def success? - $?.exitstatus == 0 + @success end def ruby_cmd