diff options
author | Nick Vatamaniuc <vatamane@apache.org> | 2017-06-08 11:50:45 -0400 |
---|---|---|
committer | Nick Vatamaniuc <nickva@users.noreply.github.com> | 2017-06-08 15:36:25 -0400 |
commit | b45ed88e7a7860744236d3a59deb04a24d64c39c (patch) | |
tree | bc1234ec22a68cb7bfa1d0b7f1ab3a6ca628aa40 | |
parent | 07fa508228d6b32b190de06e1b00be08fe8db672 (diff) | |
download | couchdb-b45ed88e7a7860744236d3a59deb04a24d64c39c.tar.gz |
Properly kill OS daemons during test
Even if it clean up fails use `kill` to avoid failing the next set of tests.
Issue: #571
-rw-r--r-- | src/couch/test/couchdb_os_daemons_tests.erl | 13 |
1 files 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 9e8be5fc3..aba1a55e0 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). |