Skip to content

Commit

Permalink
In slave, report parent PID, not child PID up to the RedisQueue.
Browse files Browse the repository at this point in the history
  • Loading branch information
weplay authored and Luke Melia and Lee Bankewitz committed Dec 7, 2009
1 parent d7e4231 commit fc15715
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion lib/testjour.rb
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion lib/testjour/result.rb
Expand Up @@ -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

Expand Down

0 comments on commit fc15715

Please sign in to comment.