summaryrefslogtreecommitdiff
path: root/lib/mnesia/test
diff options
context:
space:
mode:
Diffstat (limited to 'lib/mnesia/test')
-rw-r--r--lib/mnesia/test/Makefile5
-rw-r--r--lib/mnesia/test/mnesia_SUITE.erl8
-rw-r--r--lib/mnesia/test/mnesia_atomicity_test.erl24
-rw-r--r--lib/mnesia/test/mnesia_config_backup.erl4
-rw-r--r--lib/mnesia/test/mnesia_config_test.erl6
-rw-r--r--lib/mnesia/test/mnesia_consistency_test.erl33
-rw-r--r--lib/mnesia/test/mnesia_dbn_meters.erl10
-rw-r--r--lib/mnesia/test/mnesia_dirty_access_test.erl33
-rw-r--r--lib/mnesia/test/mnesia_durability_test.erl18
-rw-r--r--lib/mnesia/test/mnesia_evil_coverage_test.erl61
-rw-r--r--lib/mnesia/test/mnesia_examples_test.erl5
-rw-r--r--lib/mnesia/test/mnesia_frag_test.erl6
-rw-r--r--lib/mnesia/test/mnesia_isolation_test.erl25
-rw-r--r--lib/mnesia/test/mnesia_recovery_test.erl16
-rw-r--r--lib/mnesia/test/mnesia_test_lib.erl49
-rw-r--r--lib/mnesia/test/mnesia_tpcb.erl4
-rw-r--r--lib/mnesia/test/mnesia_trans_access_test.erl4
-rw-r--r--lib/mnesia/test/mt.erl26
18 files changed, 183 insertions, 154 deletions
diff --git a/lib/mnesia/test/Makefile b/lib/mnesia/test/Makefile
index b77be46e7a..c3fbad88ca 100644
--- a/lib/mnesia/test/Makefile
+++ b/lib/mnesia/test/Makefile
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1996-2021. All Rights Reserved.
+# Copyright Ericsson AB 1996-2022. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -91,6 +91,7 @@ RELSYSDIR = $(RELEASE_PATH)/mnesia_test
# FLAGS
# ----------------------------------------------------
#ERL_COMPILE_FLAGS +=
+ERL_COMPILE_FLAGS := $(filter-out +deterministic,$(ERL_COMPILE_FLAGS))
EBIN = .
@@ -98,7 +99,7 @@ EBIN = .
# Targets
# ----------------------------------------------------
-tests debug opt: $(TARGET_FILES)
+tests $(TYPES): $(TARGET_FILES)
$(TARGET_FILES): $(HRL_FILES)
diff --git a/lib/mnesia/test/mnesia_SUITE.erl b/lib/mnesia/test/mnesia_SUITE.erl
index 5e95e1dce7..123d16023f 100644
--- a/lib/mnesia/test/mnesia_SUITE.erl
+++ b/lib/mnesia/test/mnesia_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2021. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2023. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -42,7 +42,7 @@ suite() -> [{ct_hooks,[{ts_install_cth,[{nodenames,2}]}]}].
%% Verify that Mnesia really is a distributed real-time DBMS.
%% This is the test suite of the Mnesia DBMS. The test suite
-%% covers many aspects of usage and is indended to be developed
+%% covers many aspects of usage and is intended to be developed
%% incrementally. The test suite is divided into a hierarchy of test
%% suites where the leafs actually implements the test cases.
%% The intention of each test case and sub test suite can be
@@ -162,8 +162,8 @@ clean_up_suite(suite) ->
[];
clean_up_suite(Config) when is_list(Config)->
mnesia:kill(),
- Slaves = mnesia_test_lib:lookup_config(nodenames, Config),
- Nodes = lists:delete(node(), Slaves),
+ NodeNames = mnesia_test_lib:lookup_config(nodenames, Config),
+ Nodes = lists:delete(node(), NodeNames),
rpc:multicall(Nodes, erlang, halt, []),
ok.
diff --git a/lib/mnesia/test/mnesia_atomicity_test.erl b/lib/mnesia/test/mnesia_atomicity_test.erl
index 4764f9e7c0..e079100a4c 100644
--- a/lib/mnesia/test/mnesia_atomicity_test.erl
+++ b/lib/mnesia/test/mnesia_atomicity_test.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2018. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2022. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -111,7 +111,7 @@ explicit_abort_in_middle_of_trans(Config) when is_list(Config) ->
%% Start a transaction on one node
{success, [A]} = ?start_activities([Node1]),
- %% store an object in the Tab - first tranaction
+ %% store an object in the Tab - first transaction
?start_transactions([A]),
A ! fun() ->
mnesia:write(Rec1A) % returns ok when successful
@@ -136,7 +136,7 @@ explicit_abort_in_middle_of_trans(Config) when is_list(Config) ->
%% Start a second transactionprocess, after the first failed
{success, [B]} = ?start_activities([Node1]),
- %% check, whether the interupted transaction had no influence on the db
+ %% check, whether the interrupted transaction had no influence on the db
?start_transactions([B]),
B ! fun() ->
?match([Rec1A], mnesia:read({Tab, 1})),
@@ -163,7 +163,7 @@ runtime_error_in_middle_of_trans(Config) when is_list(Config) ->
%% Start a transaction on one node
{success, [A]} = ?start_activities([Node1]),
- %% store an object in the Tab - first tranaction
+ %% store an object in the Tab - first transaction
?start_transactions([A]),
A ! fun() ->
mnesia:write(Rec1A) % returns ok when successful
@@ -188,7 +188,7 @@ runtime_error_in_middle_of_trans(Config) when is_list(Config) ->
%% Start a second transactionprocess, after the first failed
{success, [B]} = ?start_activities([Node1]),
- %% check, whether the interupted transaction had no influence on the db
+ %% check, whether the interrupted transaction had no influence on the db
?start_transactions([B]),
B ! fun() ->
?match([Rec1A], mnesia:read({Tab, 1})),
@@ -215,7 +215,7 @@ kill_self_in_middle_of_trans(Config) when is_list(Config) ->
%% Start a transaction on one node
{success, [A]} = ?start_activities([Node1]),
- %% store an object in the Tab - first tranaction
+ %% store an object in the Tab - first transaction
?start_transactions([A]),
A ! fun() ->
mnesia:write(Rec1A) % returns ok when successful
@@ -244,7 +244,7 @@ kill_self_in_middle_of_trans(Config) when is_list(Config) ->
%% Start a second transactionprocess, after the first failed
{success, [B]} = ?start_activities([Node1]),
- %% check, whether the interupted transaction had no influence on the db
+ %% check, whether the interrupted transaction had no influence on the db
?start_transactions([B]),
B ! fun() ->
?match([Rec1A], mnesia:read({Tab, 1})),
@@ -271,7 +271,7 @@ throw_in_middle_of_trans(Config) when is_list(Config) ->
%% Start a transaction on one node
{success, [A]} = ?start_activities([Node1]),
- %% store an object in the Tab - first tranaction
+ %% store an object in the Tab - first transaction
?start_transactions([A]),
A ! fun() ->
mnesia:write(Rec1A) % returns ok when successful
@@ -297,7 +297,7 @@ throw_in_middle_of_trans(Config) when is_list(Config) ->
%% Start a second transactionprocess, after the first failed
{success, [B]} = ?start_activities([Node1]),
- %% check, whether the interupted transaction had no influence on the db
+ %% check, whether the interrupted transaction had no influence on the db
?start_transactions([B]),
B ! fun() ->
?match([Rec1A], mnesia:read({Tab, 1})),
@@ -542,7 +542,7 @@ start_lock_waiter(BlockOpA, BlockOpB, Config) ->
io:format("waiting for A (~p on ~p) to be in the queue ~n", [A, [N1, N2]]),
wait_for_a(A, [N1, N2]),
- io:format("Queus ~p~n",
+ io:format("Queues ~p~n",
[[{N,rpc:call(N, mnesia, system_info, [lock_queue])} || N <- Nodes]]),
KillNode = node(B),
@@ -743,7 +743,7 @@ start_restart_check(RestartOp, ReplicaNeed, Config) ->
Wait(Wait),
A ! go_ahead,
- %% the sticky write doesnt work on remote nodes !!!
+ %% the sticky write doesn't work on remote nodes !!!
ExpectedMsg =
case RestartOp of
sw when ReplicaNeed == two ->
@@ -765,7 +765,7 @@ start_restart_check(RestartOp, ReplicaNeed, Config) ->
%% the expected result depends on the transaction of
- %% fun A - when that doesnt change the object in the
+ %% fun A - when that doesn't change the object in the
%% table (e.g. it is a read) then the predefined
%% value {Tabname, 1, c} is expected to be the result here
diff --git a/lib/mnesia/test/mnesia_config_backup.erl b/lib/mnesia/test/mnesia_config_backup.erl
index 239101ca92..a39e41f63d 100644
--- a/lib/mnesia/test/mnesia_config_backup.erl
+++ b/lib/mnesia/test/mnesia_config_backup.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2022. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -36,7 +36,7 @@
%% write an own module the same interface as mnesia_backup and
%% configure Mnesia so the alternate module performs the actual
%% accesses to the backup media. This means that the user may put
-%% the backup on medias that Mnesia does not know about, possibly
+%% the backup on media that Mnesia does not know about, possibly
%% on hosts where Erlang is not running.
%%
%% The OpaqueData argument is never interpreted by other parts of
diff --git a/lib/mnesia/test/mnesia_config_test.erl b/lib/mnesia/test/mnesia_config_test.erl
index 7f584e35f9..4ba560e25d 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-2021. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2023. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -106,7 +106,7 @@ all() ->
dump_log_load_regulation, {group, dump_log_thresholds},
dump_log_update_in_place,
event_module, backend_plugin_registration,
- inconsistent_database, max_wait_for_decision,
+ inconsistent_database, %% max_wait_for_decision,
send_compressed, app_test, {group, schema_config},
unknown_config].
@@ -937,7 +937,7 @@ start_first_one_disc_less_then_two_more_disc_less(Config) when is_list(Config) -
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
schema_location_and_extra_db_nodes_combinations(doc)->
- ["Test schema loaction and extra_db_nodes combinations."];
+ ["Test schema location and extra_db_nodes combinations."];
schema_location_and_extra_db_nodes_combinations(suite) -> [];
schema_location_and_extra_db_nodes_combinations(Config) when is_list(Config) ->
[N1, N2] = Nodes = ?init(2, Config),
diff --git a/lib/mnesia/test/mnesia_consistency_test.erl b/lib/mnesia/test/mnesia_consistency_test.erl
index 46bafaf65c..73093b9227 100644
--- a/lib/mnesia/test/mnesia_consistency_test.erl
+++ b/lib/mnesia/test/mnesia_consistency_test.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2018. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2023. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -27,7 +27,6 @@
all/0, groups/0]).
-export([consistency_after_change_table_copy_type/1,
- consistency_after_rename_of_node/1,
consistency_after_restart_1_ram/1,
consistency_after_restart_1_disc/1,
consistency_after_restart_1_disc_only/1,
@@ -110,9 +109,8 @@ all() ->
{group, consistency_after_del_replica},
{group, consistency_after_move_replica},
{group, consistency_after_transform_table},
- consistency_after_change_table_copy_type,
+ %% consistency_after_change_table_copy_type,
{group, consistency_after_restore},
- consistency_after_rename_of_node,
{group, checkpoint_retainer_consistency},
{group, backup_consistency}].
@@ -341,7 +339,7 @@ receive_messages(ListOfMsgs) ->
?verbose("I (~p) got msg ~p from ~p ~n", [self(),Msg, Pid]),
[{Pid, Msg} | receive_messages(ListOfMsgs -- [Msg])]
end;
- Else -> ?warning("Recevied unexpected Msg~n ~p ~n", [Else])
+ Else -> ?warning("Received unexpected Msg~n ~p ~n", [Else])
after timer:minutes(3) ->
?error("Timeout in receive msgs while waiting for ~p~n",
[ListOfMsgs])
@@ -381,7 +379,7 @@ consistency_after_restart(ReplicaType, NodeConfig, Config) ->
TpcbConfig = tpcb_config(ReplicaType, NodeConfig, Nodes, [Node1]),
mnesia_tpcb:init(TpcbConfig),
A ! fun () -> mnesia_tpcb:run(TpcbConfig) end,
- timer:sleep(timer:seconds(10)),
+ timer:sleep(timer:seconds(3)),
mnesia_test_lib:kill_mnesia([Node1]),
%% Start and wait for tables to be loaded on all nodes
timer:sleep(timer:seconds(3)),
@@ -408,7 +406,7 @@ consistency_after_dump_tables(ReplicaType, NodeConfig, Config) ->
TpcbConfig = tpcb_config(ReplicaType, NodeConfig, Nodes, []),
mnesia_tpcb:init(TpcbConfig),
A ! fun() -> mnesia_tpcb:run(TpcbConfig) end,
- timer:sleep(timer:seconds(10)),
+ timer:sleep(timer:seconds(3)),
?match({atomic, ok}, rpc:call(Node1, mnesia, dump_tables,
[[branch, teller, account, history]])),
mnesia_tpcb:stop(),
@@ -459,7 +457,7 @@ consistency_after_add_replica(ReplicaType, NodeConfig, Config) ->
TpcbConfig = tpcb_config(ReplicaType, NodeConfig, Nodes, []),
mnesia_tpcb:init(TpcbConfig),
A ! fun () -> mnesia_tpcb:run(TpcbConfig) end,
- timer:sleep(timer:seconds(10)),
+ timer:sleep(timer:seconds(2)),
?match({atomic, ok}, mnesia:add_table_copy(account, AddNode, ReplicaType)),
mnesia_tpcb:stop(),
?match(ok, mnesia_tpcb:verify_tabs()),
@@ -501,7 +499,7 @@ consistency_after_del_replica(ReplicaType, NodeConfig, Config) ->
TpcbConfig = tpcb_config(ReplicaType, NodeConfig, Nodes, []),
mnesia_tpcb:init(TpcbConfig),
A ! fun () -> mnesia_tpcb:run(TpcbConfig) end,
- timer:sleep(timer:seconds(10)),
+ timer:sleep(timer:seconds(3)),
?match({atomic, ok}, mnesia:del_table_copy(account, Node2)),
mnesia_tpcb:stop(),
?match(ok, mnesia_tpcb:verify_tabs()),
@@ -543,7 +541,7 @@ consistency_after_move_replica(ReplicaType, NodeConfig, Config) ->
TpcbConfig = tpcb_config(ReplicaType, NodeConfig, Nodes -- [Node2], []),
mnesia_tpcb:init(TpcbConfig),
A ! fun () -> mnesia_tpcb:run(TpcbConfig) end,
- timer:sleep(timer:seconds(10)),
+ timer:sleep(timer:seconds(3)),
?match({atomic, ok}, mnesia:move_table_copy(account, Node1, Node2)),
?log("First move completed from node ~p to ~p ~n", [Node1, Node2]),
?match({atomic, ok}, mnesia:move_table_copy(account, Node2, Node1)),
@@ -585,8 +583,8 @@ consistency_after_transform_table(Type, Config) ->
[k,a,n]) || Tab <- Tabs]),
[?match([k,a,n], mnesia:table_info(Tab, attributes)) || Tab <- Tabs],
- Filter = fun(Tab) -> mnesia:foldl(fun(A, Acc) when size(A) == 3 -> [A|Acc];
- (A, Acc) when size(A) == 4 -> Acc
+ Filter = fun(Tab) -> mnesia:foldl(fun(A, Acc) when tuple_size(A) == 3 -> [A|Acc];
+ (A, Acc) when tuple_size(A) == 4 -> Acc
end, [], Tab)
end,
@@ -638,7 +636,7 @@ consistency_after_fallback_3_disc_only(Config) when is_list(Config) ->
consistency_after_fallback(ReplicaType, NodeConfig, Config) ->
put(mnesia_test_verbose, true),
%%?verbose("Starting consistency_after_fallback2 at ~p~n", [self()]),
- Delay = 5,
+ Delay = 3,
Nodes = ?acquire_nodes(NodeConfig, [{tc_timeout, timer:minutes(10)} | Config]),
Node1 = hd(Nodes),
%%?verbose("Mnesia info: ~p~n", [mnesia:info()]),
@@ -821,11 +819,6 @@ restore_verify_tabs([Tab | R]) ->
restore_verify_tabs([]) ->
ok.
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-consistency_after_rename_of_node(doc) ->
- ["Skipped because it is an unimportant case."].
-
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -867,7 +860,7 @@ updates_during_checkpoint_activation_3_disc_only(Config) when is_list(Config) ->
updates_during_checkpoint_activation(ReplicaType,NodeConfig,Config) ->
%%?verbose("updates_during_checkpoint_activation2 at ~p~n", [self()]),
- Delay = 5,
+ Delay = 2,
Nodes = ?acquire_nodes(NodeConfig, Config),
Node1 = hd(Nodes),
%%?verbose("Mnesia info: ~p~n", [mnesia:info()]),
@@ -922,7 +915,7 @@ updates_during_checkpoint_iteration_2_disc_only(Config) when is_list(Config) ->
updates_during_checkpoint_iteration(ReplicaType,NodeConfig,Config) ->
%?verbose("updates_during_checkpoint_iteration2 at ~p~n", [self()]),
- Delay = 5,
+ Delay = 2,
Nodes = ?acquire_nodes(NodeConfig, Config),
Node1 = hd(Nodes),
%?verbose("Mnesia info: ~p~n", [mnesia:info()]),
diff --git a/lib/mnesia/test/mnesia_dbn_meters.erl b/lib/mnesia/test/mnesia_dbn_meters.erl
index 407d7c65b8..d66da2fb6b 100644
--- a/lib/mnesia/test/mnesia_dbn_meters.erl
+++ b/lib/mnesia/test/mnesia_dbn_meters.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2023. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -64,12 +64,12 @@ start(Config,Nodes,Meters) ->
config(one_ram_only,[Single|_]) ->
[{ram_copies,[Single]}];
-config(ram_and_ram,[Master|[Slave|_]]) ->
- [{ram_copies,[Master,Slave]}];
+config(ram_and_ram,[N1,N2|_]) ->
+ [{ram_copies,[N1,N2]}];
config(one_disc_only,[Single|_]) ->
[{disc_copies,[Single]}];
-config(disc_and_disc,[Master|[Slave|_]]) ->
- [{disc_copies,[Master,Slave]}];
+config(disc_and_disc,[N1,N2|_]) ->
+ [{disc_copies,[N1,N2]}];
config(Config,Nodes) ->
io:format("<ERROR> Config ~p not supported or too few nodes ~p given~n",[Config,Nodes]).
diff --git a/lib/mnesia/test/mnesia_dirty_access_test.erl b/lib/mnesia/test/mnesia_dirty_access_test.erl
index e883931e36..e684faf7b0 100644
--- a/lib/mnesia/test/mnesia_dirty_access_test.erl
+++ b/lib/mnesia/test/mnesia_dirty_access_test.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2022. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2023. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -844,12 +844,12 @@ del_table(CallFrom, DelNode, [Node1, Node2, Node3]) ->
Pid3 = spawn_link(Node3, ?MODULE, update_trans, [Tab, 3, 0]),
- dbg:tracer(process, {fun(Msg,_) -> tracer(Msg) end, void}),
+ %% dbg:tracer(process, {fun(Msg,_) -> tracer(Msg) end, void}),
%% dbg:n(Node2),
%% dbg:n(Node3),
%% dbg:tp('_', []),
%% dbg:tpl(dets, [timestamp]),
- dbg:p(Pid1, [m,c,timestamp]),
+ %% dbg:p(Pid1, [m,c,timestamp]),
?match({atomic, ok},
rpc:call(CallFrom, mnesia, del_table_copy, [Tab, DelNode])),
@@ -872,17 +872,6 @@ del_table(CallFrom, DelNode, [Node1, Node2, Node3]) ->
verify_oids(Tab, Node1, Node2, Node3, R1, R2, R3),
?verify_mnesia([Node1, Node2, Node3], []).
-tracer({trace_ts, _, send, Msg, Pid, {_,S,Ms}}) ->
- io:format("~p:~p ~p >> ~w ~n",[S,Ms,Pid,Msg]);
-tracer({trace_ts, _, 'receive', Msg, {_,S,Ms}}) ->
- io:format("~p:~p << ~w ~n",[S,Ms,Msg]);
-
-
-tracer(Msg) ->
- io:format("UMsg ~p ~n",[Msg]),
- ok.
-
-
add_table_copy_1(suite) -> [];
add_table_copy_1(Config) when is_list(Config) ->
@@ -929,6 +918,22 @@ add_table(CallFrom, AddNode, [Node1, Node2, Node3], Def) ->
verify_oids(Tab, Node1, Node2, Node3, R1, R2, R3),
?verify_mnesia([Node1, Node2, Node3], []).
+
+tracer({trace_ts, From, send, Msg, To, {_,S,Ms}}) ->
+ io:format("~p:~p ~p(~p) >>~p ~w ~n",[S,Ms,From,node(From),To,Msg]);
+tracer({trace_ts, Pid, 'receive', Msg, {_,S,Ms}}) ->
+ io:format("~p:~p ~p(~p) << ~w ~n",[S,Ms,Pid,node(Pid),Msg]);
+
+tracer({trace_ts, Pid, call, MFA, ST, {_,S,Ms}}) ->
+ io:format("~p:~p ~p(~p) ~w ~w ~n",[S,Ms,Pid,node(Pid),MFA, ST]);
+tracer({trace_ts, Pid, return_from, MFA, Ret, {_,S,Ms}}) ->
+ io:format("~p:~p ~p(~p) ~w => ~w ~n",[S,Ms,Pid,node(Pid),MFA,Ret]);
+
+tracer(Msg) ->
+ io:format("UMsg ~p ~n",[Msg]),
+ ok.
+
+
move_table_copy_1(suite) -> [];
move_table_copy_1(Config) when is_list(Config) ->
[Node1, Node2, Node3] = Nodes = ?acquire_nodes(3, Config),
diff --git a/lib/mnesia/test/mnesia_durability_test.erl b/lib/mnesia/test/mnesia_durability_test.erl
index ccbfdc9738..986d0efcb5 100644
--- a/lib/mnesia/test/mnesia_durability_test.erl
+++ b/lib/mnesia/test/mnesia_durability_test.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2018. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2022. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -503,7 +503,7 @@ load_when_down_from_all_other_replica_nodes(Config) when is_list(Config) ->
?match([], mnesia_test_lib:kill_mnesia([N2])),
?match({atomic,ok},rpc:call(N3,mnesia,transaction,[Write_one,[33,33]])),
?match([], mnesia_test_lib:kill_mnesia([N3])),
- ?verbose("Mnesia stoped on all three nodes.~n",[]),
+ ?verbose("Mnesia stopped on all three nodes.~n",[]),
%%Start Mnesia on N3; wait for 'test_rec' table to load
?match(ok, rpc:call(N3, mnesia, start, [])),
@@ -528,7 +528,7 @@ load_when_down_from_all_other_replica_nodes(Config) when is_list(Config) ->
late_load_transforms_into_disc_load(doc) ->
["Difficult case that needs instrumentation of Mnesia.",
"A table is force loaded, and Mnesia decides to load it from another ",
- "Mnesia node because it is avaliable there. The other Mnesia node then ",
+ "Mnesia node because it is available there. The other Mnesia node then ",
"dies in mid copy which shall make the first Mnesia node to really ",
"force load from disc.",
"Check this by starting N1 and N2 and replicating a table between ",
@@ -1028,7 +1028,7 @@ master_nodes(Config) when is_list(Config) ->
?match({timeout, [Tab]}, rpc:call(A, mnesia, wait_for_tables, [[Tab], 2000])),
%% Test 6: Force load on table that couldn't be loaded due to master
- %% table setttings, loads other active replicas i.e. from C
+ %% table settings, loads other active replicas i.e. from C
?match(yes, rpc:call(A, mnesia, force_load_table, [Tab])),
?match(ok, rpc:call(A, mnesia, wait_for_tables, [[Tab], 3000])),
@@ -1041,7 +1041,7 @@ master_nodes(Config) when is_list(Config) ->
?match([{Tab, 1, update_2}], rpc:call(C, mnesia, dirty_read, [{Tab, 1}])),
%% Test 7: Master [B] and B is down the table should not be loaded,
- %% force_load when there are no active replicas availible
+ %% force_load when there are no active replicas available
%% should generate a load of a local table
?match(ok, rpc:call(A, mnesia, set_master_nodes, [Tab, [B]])),
@@ -1138,7 +1138,7 @@ master_on_non_local_tables(Config) when is_list(Config) ->
remote_force_load_with_local_master_node(doc) ->
["Force load a table on a remote node while the ",
"local node is down. Start the local node and ",
- "verfify that the tables is loaded from disc locally "
+ "verify that the tables is loaded from disc locally "
"if the local node has itself as master node and ",
"the remote node has both the local and remote node ",
"as master nodes"];
@@ -1345,13 +1345,13 @@ dump_ram_copies(Config) when is_list(Config) ->
%% start Mnesia only on node 3
?verbose("starting mnesia on Node3~n",[]),
- %% test_lib:mnesia_start doesnt work, because it waits
+ %% test_lib:mnesia_start doesn't work, because it waits
%% for the schema on all nodes ... ???
?match(ok,rpc:call(Node3,mnesia,start,[]) ),
?match(ok,rpc:call(Node3,mnesia,wait_for_tables,
[[Tab],timer:seconds(30)] ) ),
- %% node3 shall have the conents of the dump
+ %% node3 shall have the contents of the dump
cross_check_tables([C],Tab,{[{Tab,1,4711}],[{Tab,2,42}],[{Tab,3,256}]}),
%% start Mnesia on the other 2 nodes, too
@@ -1569,7 +1569,7 @@ receive_messages(ListOfMsgs) ->
[{Pid, Msg} | receive_messages(ListOfMsgs -- [Msg])]
end;
- Else -> ?warning("Recevied unexpected Msg~n ~p ~n", [Else])
+ Else -> ?warning("Received unexpected Msg~n ~p ~n", [Else])
after timer:seconds(40) ->
?error("Timeout in receive msgs while waiting for ~p~n",
[ListOfMsgs])
diff --git a/lib/mnesia/test/mnesia_evil_coverage_test.erl b/lib/mnesia/test/mnesia_evil_coverage_test.erl
index 1c84774e6f..3a697ba16d 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-2021. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2022. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -30,7 +30,7 @@
-export([system_info/1, table_info/1, error_description/1,
db_node_lifecycle/1, evil_delete_db_node/1, start_and_stop/1,
checkpoint/1, table_lifecycle/1, storage_options/1,
- add_copy_conflict/1, add_copy_when_going_down/1,
+ add_copy_conflict/1, add_copy_when_going_down/1, add_copy_when_dst_going_down/1,
add_copy_with_down/1,
replica_management/1, clear_table_during_load/1,
schema_availability/1, local_content/1,
@@ -66,7 +66,8 @@ all() ->
db_node_lifecycle, evil_delete_db_node, start_and_stop,
checkpoint, table_lifecycle, storage_options,
add_copy_conflict,
- add_copy_when_going_down, add_copy_with_down, replica_management,
+ add_copy_when_going_down, add_copy_when_dst_going_down, add_copy_with_down,
+ replica_management,
clear_table_during_load,
schema_availability, local_content,
{group, table_access_modifications}, replica_location,
@@ -696,7 +697,7 @@ verify_ll_queue(N) ->
?match(granted,mnesia_controller:block_controller()),
case mnesia_controller:get_info(1000) of
{info,{state,_,true,[],_Loader,[],[],[],_,_,_,_,_,_}} ->
- %% Very slow SMP machines havn't loaded it yet..
+ %% Very slow SMP machines haven't loaded it yet..
mnesia_controller:unblock_controller(),
timer:sleep(10),
verify_ll_queue(N-1);
@@ -735,6 +736,54 @@ add_copy_when_going_down(Config) ->
?match_receive({test,{aborted,_}}),
?verify_mnesia([Node2], []).
+add_copy_when_dst_going_down(suite) -> [];
+add_copy_when_dst_going_down(doc) ->
+ ["Table copy destination node goes down. Verify that the issue fixed in erlang/otp#6013 doesn't happen again, whitebox testing."];
+add_copy_when_dst_going_down(Config) ->
+ [Node1, Node2] = ?acquire_nodes(2, Config),
+ ?match({atomic, ok}, mnesia:create_table(a, [{ram_copies, [Node1]}])),
+ lists:foreach(fun(I) ->
+ ok = mnesia:sync_dirty(fun() -> mnesia:write({a, I, I}) end)
+ end,
+ lists:seq(1, 100000)),
+ ?match({ok, _}, mnesia:change_config(extra_db_nodes, [Node2])),
+
+ %% Start table copy
+ Tester = self(),
+ spawn_link(fun() ->
+ mnesia:add_table_copy(a, Node2, ram_copies),
+ Tester ! add_table_copy_finished
+ end),
+ timer:sleep(10), % Wait for `mnesia_loader:send_more/6` has started
+
+ %% Grab a write lock
+ spawn_link(fun() ->
+ Fun = fun() ->
+ ok = mnesia:write_lock_table(a),
+ Tester ! {write_lock_acquired, self()},
+ receive node2_mnesia_killed -> ok
+ end,
+ Tester ! write_lock_released,
+ ok
+ end,
+ mnesia:transaction(Fun)
+ end),
+ receive {write_lock_acquired, Locker} -> ok
+ end,
+ timer:sleep(200), % Wait for `mnesia_loader:send_more/6` has finished
+ ?match([], mnesia_test_lib:kill_mnesia([Node2])),
+ Locker ! node2_mnesia_killed,
+
+ receive write_lock_released -> ok
+ end,
+ receive add_table_copy_finished -> ok
+ end,
+ timer:sleep(1000), % Wait for `mnesia_loader:finish_copy/5` has acquired the read lock
+
+ %% Grab a write lock
+ ?match({atomic, ok}, mnesia:transaction(fun() -> mnesia:write_lock_table(a) end, 10)),
+ ?verify_mnesia([Node1], []).
+
add_copy_with_down(suite) -> [];
add_copy_with_down(Config) ->
%% Allow add_table_copy() with ram_copies even all other replicas are down
@@ -1295,7 +1344,7 @@ offline_set_master_nodes(Config) when is_list(Config) ->
?verify_mnesia(Nodes, []).
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%% Syncronize table with log or disc
+%% Synchronize table with log or disc
%%
%% Dump ram tables on disc
@@ -2091,7 +2140,7 @@ test_ext_sub(Tab1, Tab2, Tab3) ->
subscribe_standard(doc) ->
- ["Tests system events and the orignal table events"];
+ ["Tests system events and the original table events"];
subscribe_standard(suite) -> [];
subscribe_standard(Config) when is_list(Config)->
[N1, N2]=?acquire_nodes(2, Config),
diff --git a/lib/mnesia/test/mnesia_examples_test.erl b/lib/mnesia/test/mnesia_examples_test.erl
index 3bbb6e4d77..53062ca3eb 100644
--- a/lib/mnesia/test/mnesia_examples_test.erl
+++ b/lib/mnesia/test/mnesia_examples_test.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2018. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2023. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -44,7 +44,8 @@ end_per_testcase(Func, Conf) ->
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
all() ->
- [bup, company, meter, {group, tpcb}].
+ [bup, %% company,
+ meter, {group, tpcb}].
groups() ->
[{tpcb, [],
diff --git a/lib/mnesia/test/mnesia_frag_test.erl b/lib/mnesia/test/mnesia_frag_test.erl
index 7b37fcb684..c390ae3508 100644
--- a/lib/mnesia/test/mnesia_frag_test.erl
+++ b/lib/mnesia/test/mnesia_frag_test.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2018. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2023. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -185,7 +185,7 @@ nice_multi(Config) when is_list(Config) ->
?match([{Node2, 2}, {Node1, 2}], frag_dist(Tab)),
%% And connect another table to it, via a foreign key
- TabF = frag_slave,
+ TabF = frag_node,
PropsF = [{foreign_key, {Tab, foreign_id}}],
DefF = [{frag_properties, PropsF},
{attributes, [id, foreign_id]}],
@@ -322,7 +322,7 @@ nice_access(Config) when is_list(Config) ->
[frag_write(Tab, {Tab, Id, Id}) || Id <- lists:seq(1, 400)],
%% And connect another table to it, via a foreign key
- TabF = frag_access_slave,
+ TabF = frag_access_extra,
PropsF = [{foreign_key, {Tab, val}}],
DefF = [{frag_properties, PropsF},
{index, [val]}],
diff --git a/lib/mnesia/test/mnesia_isolation_test.erl b/lib/mnesia/test/mnesia_isolation_test.erl
index 601f46e45f..759735a7ea 100644
--- a/lib/mnesia/test/mnesia_isolation_test.erl
+++ b/lib/mnesia/test/mnesia_isolation_test.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2022. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2023. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -608,7 +608,7 @@ sticky_sync(Config) when is_list(Config) ->
%% In first transaction we initialise {dc, I} record with value 0
First = fun() ->
%% Do a lot of writes into ram copies table
- %% which on the Slave in do_commit will be
+ %% which on the N2 in do_commit will be
%% processed first
lists:foreach(fun(J) -> ok = mnesia:write(ec, {ec, J, 0}, write) end,
lists:seq(1, 750)),
@@ -630,11 +630,6 @@ sticky_sync(Config) when is_list(Config) ->
%% Fill 1000 dc records. At the end all dc records should have value 1.
{Time, ok} = timer:tc(fun() -> lists:foreach(TestFun, lists:seq(1,200)) end),
- io:format("200 trans done in ~p ~n",[Time div (1000000)]),
- case (Time div (1000000)) < 20 of
- true -> lists:foreach(TestFun, lists:seq(201,1000));
- false -> ignore %% Some virtual test machines are really slow..
- end,
io:format("Written, check content~n",[]),
All = fun() -> mnesia:select(dc, [ {{dc, '_', 0}, [] ,['$_']} ]) end,
?match({atomic, []}, rpc:call(N1, mnesia, sync_transaction, [All])),
@@ -967,7 +962,7 @@ snmp_open_table(Config) when is_list(Config) ->
A ! end_trans, %% Kill A, locks should be released
?match_receive({A,{atomic,end_trans}}),
- %% Locks released! op should be exec. Can take a while (thats the timeout)
+ %% Locks released! op should be exec. Can take a while (that's the timeout)
receive
Msg -> ?match({Pid, {atomic, ok}}, Msg)
after
@@ -999,7 +994,7 @@ snmp_close_table(Config) when is_list(Config) ->
A ! end_trans, %% Kill A, locks should be released
?match_receive({A,{atomic,end_trans}}),
- %% Locks released! op should be exec. Can take a while (thats the timeout)
+ %% Locks released! op should be exec. Can take a while (that's the timeout)
receive
Msg -> ?match({Pid, {atomic, ok}}, Msg)
after
@@ -1729,7 +1724,7 @@ write_shadows(Config) when is_list(Config) ->
?match({atomic, ok}, mnesia:transaction(Fun1)),
Fun2 = fun() ->
- %% write shadow old write - is the confirmed value visable
+ %% write shadow old write - is the confirmed value visible
%% in the shadow ?
?match([RecA1], mnesia:read({Tab, a})),
?match([RecA1], mnesia:wread({Tab, a})),
@@ -1738,14 +1733,14 @@ write_shadows(Config) when is_list(Config) ->
?match([RecA1], mnesia:index_match_object(PatA1, ValPos)),
?match([RecA1], mnesia:index_read(Tab, 1, ValPos)),
- %% write shadow new write - is a new value visable instead
+ %% write shadow new write - is a new value visible instead
%% of the old value ?
?match(ok, mnesia:write(RecA2)),
?match([RecA2], mnesia:read({Tab, a})),
?match([RecA2], mnesia:wread({Tab, a})),
?match([], mnesia:match_object(PatA1)), %% delete shadow old but not new write
- ?match([RecA2], mnesia:match_object(PatA2)), %% is the new value visable
+ ?match([RecA2], mnesia:match_object(PatA2)), %% is the new value visible
?match([a], mnesia:all_keys(Tab)),
?match([RecA2], mnesia:index_match_object(PatA2, ValPos)),
@@ -1798,7 +1793,7 @@ delete_shadows(Config) when is_list(Config) ->
?match([], mnesia:index_match_object(PatA1, ValPos)),
?match([], mnesia:index_read(Tab, 1, ValPos)),
- %% delete shadow old but not new write - is the new value visable
+ %% delete shadow old but not new write - is the new value visible
%% when the old one was deleted ?
?match(ok, mnesia:write(RecA2)),
@@ -1883,7 +1878,7 @@ write_delete_shadows_bag(Config) when is_list(Config) ->
?match([], mnesia:index_match_object(PatA1, ValPos)),
?match([], mnesia:index_read(Tab, 1, ValPos)),
- %% delete shadow old but not new write - are both new value visable
+ %% delete shadow old but not new write - are both new value visible
%% when the old one was deleted ?
?match(ok, mnesia:write(RecA2)),
?match(ok, mnesia:write(RecA3)),
@@ -2143,7 +2138,7 @@ removed_resources([_N1,N2,N3], DeleteRes) ->
nasty(suite) -> [];
nasty(doc) ->
- ["Tries to fullfill a rather nasty locking scenario, where we have had "
+ ["Tries to fulfill a rather nasty locking scenario, where we have had "
"bugs, the testcase tries a combination of locks in locker queue"];
%% This testcase no longer works as it was intended to show errors when
diff --git a/lib/mnesia/test/mnesia_recovery_test.erl b/lib/mnesia/test/mnesia_recovery_test.erl
index b5749408f8..498550c8ec 100644
--- a/lib/mnesia/test/mnesia_recovery_test.erl
+++ b/lib/mnesia/test/mnesia_recovery_test.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2018. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2023. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -28,7 +28,6 @@
-export([coord_dies/1, after_full_disc_partition/1,
disc_less/1, garb_decision/1,
- system_upgrade/1,
delete_during_start/1,
no_master_2/1, no_master_3/1, one_master_2/1, one_master_3/1,
two_master_2/1, two_master_3/1, all_master_2/1,
@@ -120,9 +119,9 @@ all() ->
[{group, mnesia_down}, {group, explicit_stop},
coord_dies, {group, schema_trans}, {group, async_dirty},
{group, sync_dirty}, {group, sym_trans},
- {group, asym_trans}, after_full_disc_partition,
- {group, after_corrupt_files}, disc_less, garb_decision,
- system_upgrade].
+ {group, asym_trans}, %% after_full_disc_partition,
+ {group, after_corrupt_files}, disc_less, garb_decision
+ ].
groups() ->
[{schema_trans, [],
@@ -1341,7 +1340,7 @@ garb_of_decisions(Kill, Nodes, Tid_list, Trans_res) ->
case length(Tid_list) of
1 ->
%% If there was only one transaction, it should be logged as
- %% comitted on every node!
+ %% committed on every node!
[Tid1] = Tid_list,
verify_garb_transient_logs(Nodes, [Tid1], committed);
2 ->
@@ -1455,7 +1454,7 @@ receive_messages(ListOfMsgs, File, Line) ->
[{Pid, Msg} | receive_messages(ListOfMsgs -- [Msg], File, Line)]
end;
Else -> mnesia_test_lib:log("<>WARNING<>~n"
- "Recevied unexpected or bad formatted msg~n ~p ~n"
+ "Received unexpected or bad formatted msg~n ~p ~n"
"While waiting for ~p~n",
[Else, ListOfMsgs], File, Line),
receive_messages(ListOfMsgs, File, Line)
@@ -1645,9 +1644,6 @@ disc_less(Config) when is_list(Config) ->
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-system_upgrade(doc) ->
- ["Test on-line and off-line upgrade of the Mnesia application"].
-
garb_decision(doc) ->
["Test that decisions are garbed correctly."];
garb_decision(suite) -> [];
diff --git a/lib/mnesia/test/mnesia_test_lib.erl b/lib/mnesia/test/mnesia_test_lib.erl
index 9794915026..6bf44295b3 100644
--- a/lib/mnesia/test/mnesia_test_lib.erl
+++ b/lib/mnesia/test/mnesia_test_lib.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2021. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2023. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -44,7 +44,7 @@
%%% specified in the Config, the test case is skipped. If there
%%% was enough node names in the Config, X of them are selected
%%% and if some of them happens to be down they are restarted
-%%% via the slave module. When all nodes are up and running a
+%%% via the peer module. When all nodes are up and running a
%%% disk resident schema is created on all nodes and Mnesia is
%%% started a on all nodes. This means that all test cases may
%%% assume that Mnesia is up and running on all acquired nodes.
@@ -62,7 +62,7 @@
%%% test(TestCases)
%%%
%%% Run parts of the test suite. Uses test/2.
-%%% Reads Config from mnesia_test.config and starts them if neccessary.
+%%% Reads Config from mnesia_test.config and starts them if necessary.
%%% Kills Mnesia and wipes out the Mnesia directories as a starter.
%%%
%%% test(TestCases, Config)
@@ -97,9 +97,7 @@
select_nodes/4,
init_nodes/3,
error/4,
- slave_start_link/0,
- slave_start_link/1,
- slave_sup/0,
+ node_sup/0,
start_mnesia/1,
start_mnesia/2,
@@ -236,26 +234,14 @@ mk_nodes(N, Nodes) when N > 0 ->
mk_node(N, Name, Host) ->
list_to_atom(lists:concat([Name ++ integer_to_list(N) ++ "@" ++ Host])).
-slave_start_link() ->
- slave_start_link(node()).
+node_start_link(Host, Name) ->
+ node_start_link(Host, Name, 10).
-slave_start_link(Node) ->
- [Local, Host] = node_to_name_and_host(Node),
- Count = erlang:unique_integer([positive]),
- List = [Local, "_", Count],
- Name = list_to_atom(lists:concat(List)),
- slave_start_link(list_to_atom(Host), Name).
-
-slave_start_link(Host, Name) ->
- slave_start_link(Host, Name, 10).
-
-slave_start_link(Host, Name, Retries) ->
+node_start_link(Host, Name, Retries) ->
Debug = atom_to_list(mnesia:system_info(debug)),
- Args = "-mnesia debug " ++ Debug ++
- " -pa " ++
- filename:dirname(code:which(?MODULE)) ++
- " -pa " ++
- filename:dirname(code:which(mnesia)),
+ Args = ["-mnesia", "debug", Debug,
+ "-pa", filename:dirname(code:which(?MODULE)),
+ "-pa", filename:dirname(code:which(mnesia))],
case starter(Host, Name, Args) of
{ok, NewNode} ->
?match(pong, net_adm:ping(NewNode)),
@@ -264,22 +250,23 @@ slave_start_link(Host, Name, Retries) ->
ok = rpc:call(NewNode, file, set_cwd, [Cwd]),
true = rpc:call(NewNode, code, set_path, [Path]),
ok = rpc:call(NewNode, error_logger, tty, [false]),
- spawn_link(NewNode, ?MODULE, slave_sup, []),
+ spawn_link(NewNode, ?MODULE, node_sup, []),
rpc:multicall([node() | nodes()], global, sync, []),
{ok, NewNode};
{error, Reason} when Retries == 0->
{error, Reason};
{error, Reason} ->
- io:format("Could not start slavenode ~p ~p retrying~n",
+ io:format("Could not start node ~p ~p retrying~n",
[{Host, Name, Args}, Reason]),
timer:sleep(500),
- slave_start_link(Host, Name, Retries - 1)
+ node_start_link(Host, Name, Retries - 1)
end.
starter(Host, Name, Args) ->
- slave:start(Host, Name, Args).
+ {ok, _, Node} = peer:start(#{host => Host, name => Name, args => Args}),
+ {ok, Node}.
-slave_sup() ->
+node_sup() ->
process_flag(trap_exit, true),
receive
{'EXIT', _, _} ->
@@ -722,7 +709,7 @@ kill_tc(Pid, Time) ->
"in ~p min~n", [Time div (1000*60)]),
Files = mnesia_lib:dist_coredump(),
?log("Cores dumped to:~n ~p~n", [Files]),
- %% Genarate erlang crashdumps.
+ %% Generate erlang crashdumps.
%% GenDump = fun(Node) ->
%% File = "CRASH_" ++ atom_to_list(Node) ++ ".dump",
%% rpc:call(Node, os, putenv, ["ERL_CRASH_DUMP", File]),
@@ -759,7 +746,7 @@ init_nodes([Node | Nodes], File, Line) ->
[Node | init_nodes(Nodes, File, Line)];
pang ->
[Name, Host] = node_to_name_and_host(Node),
- case slave_start_link(Host, Name) of
+ case node_start_link(Host, Name) of
{ok, Node1} ->
Path = code:get_path(),
true = rpc:call(Node1, code, set_path, [Path]),
diff --git a/lib/mnesia/test/mnesia_tpcb.erl b/lib/mnesia/test/mnesia_tpcb.erl
index fb39ee321d..6a78d4f1d0 100644
--- a/lib/mnesia/test/mnesia_tpcb.erl
+++ b/lib/mnesia/test/mnesia_tpcb.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2022. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -35,7 +35,7 @@
%% a database system.
%%
%% The definition of the TPC-B states lots of detailed rules and
-%% conditions that must be fullfilled, e.g. how the ACID (atomicity,
+%% conditions that must be fulfilled, e.g. how the ACID (atomicity,
%% consistency, isolation and durability) properties are verified,
%% how the random numbers must be distributed, minimum sizes of
%% the different types of records, minimum duration of the benchmark,
diff --git a/lib/mnesia/test/mnesia_trans_access_test.erl b/lib/mnesia/test/mnesia_trans_access_test.erl
index 65206a85af..b33b807bfc 100644
--- a/lib/mnesia/test/mnesia_trans_access_test.erl
+++ b/lib/mnesia/test/mnesia_trans_access_test.erl
@@ -722,7 +722,7 @@ nested_transactions(Config, Child, Father) ->
{[{Tab, father, not_updated}], [{Tab, child, not_updated}]}
end,
- %% Syncronize things!!
+ %% Synchronize things!!
?match({atomic, ok}, mnesia:sync_transaction(fun() -> mnesia:write({Tab, sync, sync}) end)),
?match(ChildRes, rpc:call(Node1, mnesia, dirty_read, [{Tab, child}])),
@@ -1196,7 +1196,7 @@ index_delete_object(Config) when is_list(Config) ->
?verify_mnesia(Nodes, []).
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%% Add and drop indecies
+%% Add and drop indices
add_table_index_ram(suite) -> [];
diff --git a/lib/mnesia/test/mt.erl b/lib/mnesia/test/mt.erl
index c1859bef3f..b5eea30690 100644
--- a/lib/mnesia/test/mt.erl
+++ b/lib/mnesia/test/mt.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2021. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2023. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -235,7 +235,7 @@ ping() ->
Nodes = mnesia_test_lib:select_nodes(all, Config, ?FILE, ?LINE),
[{N, net_adm:ping(N)} || N <- Nodes].
-%% Slave start all nodes in config spec
+%% Start all nodes in config spec
start_nodes() ->
Config = read_config(),
Nodes = mnesia_test_lib:select_nodes(all, Config, ?FILE, ?LINE),
@@ -245,30 +245,32 @@ start_nodes() ->
%% loop one testcase /suite until it fails
loop(Case) ->
- loop_1(Case,-1,read_config()).
+ loop_1(Case,1,infinity,read_config()).
loop(M,F) when is_atom(F) ->
- loop_1({M,F},-1,read_config());
+ loop_1({M,F},1, infinity, read_config());
loop(Case,N) when is_integer(N) ->
- loop_1(Case, N,read_config()).
+ loop_1(Case, 1, N,read_config()).
loop(M,F,N) when is_integer(N) ->
- loop_1({M,F},N,read_config()).
+ loop_1({M,F},1, N,read_config()).
+
+loop_1(Case,N,Max,Config) when N < Max ->
+ io:format("~nLoop test ~p ~n", [abs(N)]),
-loop_1(Case,N,Config) when N /= 0 ->
- io:format("Loop test ~p ~n", [abs(N)]),
case ok_result(Res = t(Case,Config)) of
true ->
- loop_1(Case,N-1,Config);
+ loop_1(Case,N+1,Max,Config);
error ->
+ io:format("Failed after ~p~n", [N]),
Res
end;
-loop_1(_,_,_) ->
+loop_1(_,_,_,_) ->
ok.
-
+
ok_result([{_T,{ok,_,_}}|R]) ->
ok_result(R);
-ok_result([{_T,{TC,List}}|R]) when is_tuple(TC), is_list(List) ->
+ok_result([{_T,{TC,List}}|R]) when is_tuple(TC), is_list(List) ->
ok_result(List) andalso ok_result(R);
ok_result([]) -> true;
ok_result(_) -> error.