From f26d0ba5d3d4c75df593b3406b9f3f3b81560e3c Mon Sep 17 00:00:00 2001 From: Hans Nilsson Date: Tue, 25 Oct 2016 11:48:33 +0200 Subject: ssh: better ssh_basic_SUITE:end_per_suite/2 The testcases shell_unicode_string and shell_no_unicode in ssh_basic_SUITE could raise an exception in the end_per_suite when stopping the dameon. This is due to a natural race condition between the server and the client. --- lib/ssh/test/ssh_basic_SUITE.erl | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'lib/ssh/test') diff --git a/lib/ssh/test/ssh_basic_SUITE.erl b/lib/ssh/test/ssh_basic_SUITE.erl index 51e0d5196b..b102ede1cb 100644 --- a/lib/ssh/test/ssh_basic_SUITE.erl +++ b/lib/ssh/test/ssh_basic_SUITE.erl @@ -343,14 +343,15 @@ end_per_testcase(TC, Config) when TC==shell_no_unicode ; TC==shell_unicode_string -> case proplists:get_value(sftpd, Config) of {Pid, _, _} -> - ssh:stop_daemon(Pid), - ssh:stop(); + catch ssh:stop_daemon(Pid); _ -> - ssh:stop() - end; + ok + end, + end_per_testcase(Config); end_per_testcase(_TestCase, Config) -> end_per_testcase(Config). -end_per_testcase(_Config) -> + +end_per_testcase(_Config) -> ssh:stop(), ok. -- cgit v1.2.3