Permalink
Browse files

In slave, report parent PID, not child PID up to the RedisQueue.

  • Loading branch information...
1 parent d7e4231 commit fc15715821f95fa9d6b42651551d047903531188 @weplay weplay committed with Luke Melia and Lee Bankewitz Dec 7, 2009
Showing with 6 additions and 2 deletions.
  1. +5 −1 lib/testjour.rb
  2. +1 −1 lib/testjour/result.rb
View
@@ -42,12 +42,16 @@ def self.logger
def self.override_logger_pid(pid)
@overridden_logger_pid = pid
end
+
+ def self.effective_pid
+ @overridden_logger_pid || $PID
+ end
def self.setup_logger(dir = "./")
@logger = Logger.new(File.expand_path(File.join(dir, "testjour.log")))
@logger.formatter = proc do |severity, time, progname, msg|
- "#{time.strftime("%b %d %H:%M:%S")} [#{@overridden_logger_pid || $PID}]: #{msg}\n"
+ "#{time.strftime("%b %d %H:%M:%S")} [#{Testjour.effective_pid}]: #{msg}\n"
end
@logger.level = Logger::DEBUG
View
@@ -31,7 +31,7 @@ def initialize(time, status, step_match = nil, exception = nil)
@backtrace = exception.backtrace.join("\n")
end
- @pid = $PID
+ @pid = Testjour.effective_pid
@hostname = Testjour.socket_hostname
end

0 comments on commit fc15715

Please sign in to comment.