Skip to content

Commit

Permalink
Made sure all redis-server processes gets killed when running tests i…
Browse files Browse the repository at this point in the history
…n distributed mode.
  • Loading branch information
niho committed Feb 9, 2012
1 parent 30cb989 commit bedaf2a
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions test/test_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,13 @@
exit_code = Test::Unit::AutoRunner.run
end

pid = `ps -A -o pid,command | grep [r]edis-test`.split(" ")[0]
puts "Killing test redis server..."
loop do
pid = `ps -A -o pid,command | grep [r]edis-test`.split(" ")[0]
break if pid.nil?
Process.kill("KILL", pid.to_i)
end
`rm -f #{dir}/*.rdb`
Process.kill("KILL", pid.to_i)
exit exit_code
end

Expand Down

0 comments on commit bedaf2a

Please sign in to comment.