diff options
author | Siri Hansen <[email protected]> | 2012-09-03 16:49:49 +0200 |
---|---|---|
committer | Siri Hansen <[email protected]> | 2012-09-03 16:49:49 +0200 |
commit | 53dfb8dbeba18fbd73d6107f171b65903d65afcb (patch) | |
tree | a1b78c0a40bcc8f0b5f36d6e34fe06cb8d98ed78 /lib/sasl | |
parent | 94fa6d2fcf729d3df37a4e8dc4e369bf444ea55a (diff) | |
download | otp-53dfb8dbeba18fbd73d6107f171b65903d65afcb.tar.gz otp-53dfb8dbeba18fbd73d6107f171b65903d65afcb.tar.bz2 otp-53dfb8dbeba18fbd73d6107f171b65903d65afcb.zip |
Fix rb_SUITE failing tests
Some tests in rb_SUITE failed every now and then depending on timing:
1. sometimes SASL printouts from cth_log_redirect were captured in
addition to expected printouts
2. sometimes test supervisor and server were not completely stopped
before next test case was started
This has been corrected.
Diffstat (limited to 'lib/sasl')
-rw-r--r-- | lib/sasl/test/rb_SUITE.erl | 27 |
1 files changed, 18 insertions, 9 deletions
diff --git a/lib/sasl/test/rb_SUITE.erl b/lib/sasl/test/rb_SUITE.erl index 35a4eb7e7b..b0e43be3a2 100644 --- a/lib/sasl/test/rb_SUITE.erl +++ b/lib/sasl/test/rb_SUITE.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2011. All Rights Reserved. +%% Copyright Ericsson AB 2011-2012. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -66,23 +66,31 @@ init_per_group(running_error_logger,Config) -> restart_sasl(), Config. -end_per_group(running_error_logger,Config) -> +end_per_group(running_error_logger,_Config) -> %% Remove log_mf_h??? ok. init_per_testcase(_Case,Config) -> case whereis(?SUP) of - undefined -> ok; - Pid -> kill(Pid) + undefined -> + ok; + Sup -> + Server = whereis(?MODULE), + exit(Sup,kill), + wait_for_down([Server,Sup]) end, empty_error_logs(Config), Config. -kill(Pid) -> +wait_for_down([]) -> + ok; +wait_for_down([undefined|Rest]) -> + wait_for_down(Rest); +wait_for_down([Pid|Rest]) -> Ref = erlang:monitor(process,Pid), - exit(Pid,kill), - receive {'DOWN', Ref, process, Pid, _Info} -> ok end. + receive {'DOWN', Ref, process, Pid, _Info} -> ok end, + wait_for_down(Rest). end_per_testcase(Case,Config) -> try apply(?MODULE,Case,[cleanup,Config]) @@ -96,8 +104,9 @@ end_per_testcase(Case,Config) -> help(_Config) -> Help = capture(fun() -> rb:h() end), - "Report Browser Tool - usage" = hd(Help), - "rb:stop - stop the rb_server" = lists:last(Help), + %% Check that first and last line is there + true = lists:member("Report Browser Tool - usage", Help), + true = lists:member("rb:stop - stop the rb_server", Help), ok. %% Test that all three sasl env vars must be set for a successful start of rb |