aboutsummaryrefslogtreecommitdiffstats
path: root/lib/mnesia/test/mnesia_install_test.erl
diff options
context:
space:
mode:
authorDan Gudmundsson <[email protected]>2011-10-27 11:01:36 +0200
committerDan Gudmundsson <[email protected]>2011-11-07 14:19:34 +0100
commit567a8276de0b146bfcbf6e81626d11694ca8edf8 (patch)
tree73774f1038567949c3bfd77c5b7cc2e9f3f291e6 /lib/mnesia/test/mnesia_install_test.erl
parentf561a98a9b89738467b52ab5213562de753f6ad2 (diff)
downloadotp-567a8276de0b146bfcbf6e81626d11694ca8edf8.tar.gz
otp-567a8276de0b146bfcbf6e81626d11694ca8edf8.tar.bz2
otp-567a8276de0b146bfcbf6e81626d11694ca8edf8.zip
[mnesia] Cleanly bring down mnesia
Aviods failing/wobbling testcase. Mnesia mishandled supervisors.
Diffstat (limited to 'lib/mnesia/test/mnesia_install_test.erl')
-rw-r--r--lib/mnesia/test/mnesia_install_test.erl23
1 files changed, 15 insertions, 8 deletions
diff --git a/lib/mnesia/test/mnesia_install_test.erl b/lib/mnesia/test/mnesia_install_test.erl
index 5d55fcac0e..3a2d44aa95 100644
--- a/lib/mnesia/test/mnesia_install_test.erl
+++ b/lib/mnesia/test/mnesia_install_test.erl
@@ -205,7 +205,7 @@ silly_upgrade(Config) when is_list(Config) ->
?match(ok, mnesia:install_fallback(Bup2)),
file:delete(Bup2),
%% Will generate intentional crash, fatal error
- ?match([], mnesia_test_lib:stop_mnesia([Node2])),
+ ?match([], mnesia_test_lib:stop_mnesia([Node2])),
wait_till_dead([Node1, Node2]),
?match([], mnesia_test_lib:start_mnesia([Node1, Node2], [Tab1, Tab2])),
?match(match, verify_state(Tab1, Tab2, CpState)),
@@ -213,22 +213,29 @@ silly_upgrade(Config) when is_list(Config) ->
?match(ok, mnesia:install_fallback(Bup)),
file:delete(Bup),
%% Will generate intentional crash, fatal error
- ?match([], mnesia_test_lib:stop_mnesia([Node1, Node2])),
+ ?match([], mnesia_test_lib:stop_mnesia([Node1, Node2])),
wait_till_dead([Node1, Node2]),
?match([], mnesia_test_lib:start_mnesia([Node1, Node2], [Tab1, Tab2])),
CpState2 = [X || X <- CpState, element(1, X) /= Tab1],
?match(match, verify_state(Tab1, Tab2, CpState2)),
?verify_mnesia(Nodes, []).
-wait_till_dead([]) -> ok;
-wait_till_dead([N|Ns]) ->
+wait_till_dead([]) ->
+ ok; %% timer:sleep(5);
+wait_till_dead(Repeat = [N|Ns]) ->
Apps = rpc:call(N, application, which_applications, []),
case lists:keymember(mnesia, 1, Apps) of
- true ->
+ true ->
timer:sleep(10),
- wait_till_dead([N|Ns]);
- false ->
- wait_till_dead(Ns)
+ wait_till_dead(Repeat);
+ false ->
+ case rpc:call(N, erlang, whereis, [mnesia_monitor]) of
+ undefined ->
+ wait_till_dead(Ns);
+ _ ->
+ timer:sleep(10),
+ wait_till_dead(Repeat)
+ end
end.
add_some_records(Tab1, Tab2, Old) ->