diff options
author | Dan Gudmundsson <[email protected]> | 2014-03-04 10:25:11 +0100 |
---|---|---|
committer | Dan Gudmundsson <[email protected]> | 2014-03-28 09:55:57 +0100 |
commit | 51becf1a05c950857424314bc7f29e97fbd6456e (patch) | |
tree | 65936ee1f0b359574b496f8ff281bee0fb8cad6c | |
parent | faae15d89ac03fce87f0370b011ed71f85d83d8b (diff) | |
download | otp-51becf1a05c950857424314bc7f29e97fbd6456e.tar.gz otp-51becf1a05c950857424314bc7f29e97fbd6456e.tar.bz2 otp-51becf1a05c950857424314bc7f29e97fbd6456e.zip |
mnesia: test harder sync
-rw-r--r-- | lib/mnesia/test/mnesia_config_test.erl | 7 | ||||
-rw-r--r-- | lib/mnesia/test/mnesia_evil_coverage_test.erl | 11 |
2 files changed, 11 insertions, 7 deletions
diff --git a/lib/mnesia/test/mnesia_config_test.erl b/lib/mnesia/test/mnesia_config_test.erl index 6baf86a4a5..c495bce63f 100644 --- a/lib/mnesia/test/mnesia_config_test.erl +++ b/lib/mnesia/test/mnesia_config_test.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1997-2013. All Rights Reserved. +%% Copyright Ericsson AB 1997-2014. 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 @@ -639,10 +639,10 @@ send_compressed(Config) -> end, ?match([], mnesia_test_lib:kill_mnesia([N2])), - + sys:get_status(mnesia_monitor), %% sync N1 ?match([], mnesia_test_lib:kill_mnesia([N1])), ?match(ok, mnesia:start([{send_compressed, 9}])), - ?match(ok, mnesia:wait_for_tables([t0,t1,t2], 5000)), + ?match(ok, mnesia:wait_for_tables([t0,t1,t2], 25000)), ?match({atomic, ok}, mnesia:transaction(Create, [t0])), ?match({atomic, ok}, mnesia:transaction(Create, [t1])), @@ -1158,6 +1158,7 @@ dynamic_basic(Config) when is_list(Config) -> %%% SYNC!!! timer:sleep(1000), + sys:get_status(mnesia_monitor), ?match([N3,N1], sort(rpc:call(N1, mnesia, system_info, [running_db_nodes]))), ?match([N3,N1], sort(rpc:call(N3, mnesia, system_info, [running_db_nodes]))), diff --git a/lib/mnesia/test/mnesia_evil_coverage_test.erl b/lib/mnesia/test/mnesia_evil_coverage_test.erl index 91820238e5..2d1623b6ca 100644 --- a/lib/mnesia/test/mnesia_evil_coverage_test.erl +++ b/lib/mnesia/test/mnesia_evil_coverage_test.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1996-2013. All Rights Reserved. +%% Copyright Ericsson AB 1996-2014. 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 @@ -671,13 +671,16 @@ add_copy_when_going_down(Config) -> ?acquire_nodes(2, Config ++ [{tc_timeout, timer:minutes(2)}]), ?match({atomic, ok}, mnesia:create_table(a, [{ram_copies, [Node1]}])), %% Grab a write lock + Tester = self(), WriteAndWait = fun() -> mnesia:write({a,1,1}), - receive continue -> ok + Tester ! {self(), got_lock}, + receive continue -> ok end end, - _Lock = spawn(fun() -> mnesia:transaction(WriteAndWait) end), - Tester = self(), + Locker = spawn(fun() -> mnesia:transaction(WriteAndWait) end), + receive {Locker, got_lock} -> ok end, + spawn_link(fun() -> Res = rpc:call(Node2, mnesia, add_table_copy, [a, Node2, ram_copies]), Tester ! {test, Res} |