From 70ed8718c319c5be0d492fcf85d4e741eedeeca1 Mon Sep 17 00:00:00 2001 From: Nick Vatamaniuc Date: Thu, 8 Jun 2017 11:50:45 -0400 Subject: [PATCH] Properly kill OS daemons during test Even if it clean up fails use `kill` to avoid failing the next set of tests. Issue: #571 --- src/couch/test/couchdb_os_daemons_tests.erl | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/couch/test/couchdb_os_daemons_tests.erl b/src/couch/test/couchdb_os_daemons_tests.erl index 9e8be5fc3e4..aba1a55e016 100644 --- a/src/couch/test/couchdb_os_daemons_tests.erl +++ b/src/couch/test/couchdb_os_daemons_tests.erl @@ -56,9 +56,16 @@ setup(DName) -> {Ctx, OsDPid}. teardown(_, {Ctx, OsDPid}) -> - test_util:stop_sync_throw(OsDPid, fun() -> - exit(OsDPid, shutdown) - end, {timeout, os_daemon_stop}, ?TIMEOUT), + try + test_util:stop_sync_throw(OsDPid, fun() -> + exit(OsDPid, shutdown) + end, {timeout, os_daemon_stop}, ?TIMEOUT) + catch + {timeout, os_daemon_stop} -> + Msg = "~nWARNING: OS daemons test stop ~p msec timeout exceeded~n", + io:format(standard_error, Msg, [?TIMEOUT]), + exit(OsDPid, kill) + end, test_util:stop(Ctx).