Chubbies actually shuts itself down now, so both builds should now be able to be green at the same time. FWIW, @ variables in class methods are class variables and therefore persist across tests.
This commit is contained in:
parent
ffb6b18ce8
commit
1ccfaedd08
1 changed files with 9 additions and 9 deletions
|
|
@ -76,14 +76,12 @@ class Chubbies
|
|||
end
|
||||
|
||||
def self.kill
|
||||
`kill -9 #{get_pid}`
|
||||
pid = self.get_pid
|
||||
`kill -9 #{pid}` if pid.present?
|
||||
end
|
||||
|
||||
def self.ensure_killed
|
||||
if !(@killed) && self.running?
|
||||
self.kill
|
||||
@killed = true
|
||||
end
|
||||
self.kill if self.running?
|
||||
end
|
||||
|
||||
def self.running?
|
||||
|
|
@ -103,10 +101,12 @@ class Chubbies
|
|||
end
|
||||
|
||||
def self.get_pid
|
||||
@pid ||= lambda {
|
||||
processes = `ps ax -o pid,command | grep "#{run_command}"`.split("\n")
|
||||
processes = processes.select{|p| !p.include?("grep") }
|
||||
processes = `ps ax -o pid,command | grep "#{run_command}"`.split("\n")
|
||||
processes = processes.select{|p| !p.include?("grep") }
|
||||
if processes.any?
|
||||
processes.first.split(" ").first
|
||||
}.call
|
||||
else
|
||||
nil
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Reference in a new issue