dcd: simplify cleanup in the test

master
Xu Cheng 2015-08-21 11:01:34 +08:00
parent 060f8e61e0
commit c16c8cbd63
1 changed files with 3 additions and 8 deletions

View File

@ -37,14 +37,9 @@ class Dcd < Formula
sleep 0.5
# query the server from a client
system "dcd-client", "-q", "-p9167"
rescue
if server
# clean up the server process
Process.kill "TERM", server
end
raise
ensure
Process.kill "TERM", server
Process.wait server
end
# Ditto
Process.kill "TERM", server
end
end