Skip to content

Commit

Permalink
Reproduction of mnesia issue-7423
Browse files Browse the repository at this point in the history
  • Loading branch information
Mikaka27 authored and zmstone committed Jan 19, 2025
1 parent 3174073 commit 258650f
Show file tree
Hide file tree
Showing 3 changed files with 73 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/mnesia/test/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ MODULES= \
mnesia_cost \
mnesia_dbn_meters \
ext_test \
mnesia_index_plugin_test
mnesia_index_plugin_test \
mnesia_external_backend_test

DocExamplesDir := ../doc/src/

Expand Down
70 changes: 70 additions & 0 deletions lib/mnesia/test/mnesia_external_backend_test.erl
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
%%
%% %CopyrightBegin%
%%
%% Copyright Ericsson AB 1996-2024. 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.
%% You may obtain a copy of the License at
%%
%% http://www.apache.org/licenses/LICENSE-2.0
%%
%% Unless required by applicable law or agreed to in writing, software
%% distributed under the License is distributed on an "AS IS" BASIS,
%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
%% See the License for the specific language governing permissions and
%% limitations under the License.
%%
%% %CopyrightEnd%
%%

-module(mnesia_external_backend_test).

-export([init_per_testcase/2, end_per_testcase/2,
init_per_group/2, end_per_group/2,
suite/0, all/0, groups/0]).

-export([
schema_merge_should_work_when_node_is_removed_from_the_cluster_and_later_rejoins/1
]).

-include("mnesia_test_lib.hrl").

-record(some_rec, {some_id :: atom(), some_int :: number(), some_string :: string()}).

all() -> [
schema_merge_should_work_when_node_is_removed_from_the_cluster_and_later_rejoins
].

groups() ->
[].

init_per_testcase(Func, Conf) ->
mnesia_test_lib:init_per_testcase(Func, Conf).

end_per_testcase(Func, Conf) ->
mnesia_test_lib:end_per_testcase(Func, Conf).

init_per_group(_GroupName, Config) ->
Config.

end_per_group(_GroupName, Config) ->
Config.

suite() -> [{ct_hooks,[{ts_install_cth,[{nodenames,3}]}]}].

schema_merge_should_work_when_node_is_removed_from_the_cluster_and_later_rejoins(Config) when is_list(Config) ->
[N1, N2] = ?acquire_nodes(2, Config),

?match({atomic,ok}, mnesia:create_table(table, [
{type, set},
{record_name, some_rec},
{attributes, record_info(fields, some_rec)},
{ext_ets, [N1, N2]}
])),

?match([], mnesia_test_lib:kill_mnesia([N2])),

?match({atomic, ok}, mnesia:del_table_copy(schema, N2)),

?match([], mnesia_test_lib:start_mnesia([N2])).
1 change: 1 addition & 0 deletions lib/mnesia/test/mt.erl
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ alias(registry) -> mnesia_registry_test;
alias(suite) -> mnesia_SUITE;
alias(trans) -> mnesia_trans_access_test;
alias(ixp) -> mnesia_index_plugin_test;
alias(external) -> mnesia_external_backend_test;
alias(Other) -> Other.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Expand Down

0 comments on commit 258650f

Please sign in to comment.