Skip to content

Commit cca3069

Browse files
committed
fakecloud: update test
Signed-off-by: Rui Chen <rui@chenrui.dev>
1 parent 1d314c5 commit cca3069

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

Formula/f/fakecloud.rb

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,16 @@ def install
3636

3737
test do
3838
port = free_port
39-
fork do
40-
exec bin/"fakecloud", "--addr", "127.0.0.1:#{port}"
41-
end
39+
40+
assert_match version.to_s, shell_output("#{bin}/fakecloud --version")
41+
42+
pid = spawn bin/"fakecloud", "--addr", "127.0.0.1:#{port}"
4243
sleep 3
4344

4445
output = shell_output("curl -s http://127.0.0.1:#{port}/_fakecloud/health 2>&1")
4546
assert_match "ok", output.downcase
46-
47-
assert_match version.to_s, shell_output("#{bin}/fakecloud --version")
47+
ensure
48+
Process.kill("TERM", pid)
49+
Process.wait(pid)
4850
end
4951
end

0 commit comments

Comments
 (0)