Skip to content

Commit 87dac54

Browse files
ansdmkuratczyk
authored andcommitted
Skip test case two_nodes_different_otp_version
Test case two_nodes_different_otp_version was introduced in #14042. In CI, the code was compiled on OTP 27. The test case then applied the Ra commands on OTP 27 and OTP 26 at runtime. For that to work the test transferred the compiled BEAM modules to the OTP 26 node. Bumping OTP to 28 causes the lower version node (be it OTP 26 or OTP 27) to error when parsing the atom table chunk of the BEAM file that was compiled in OTP 28: ``` corrupt atom table {error,badfile} ``` That's expected as described in erlang/otp#8913 (comment) since erlang/otp#8913 changes the atom table chunk format in the BEAM files. ``` beam_lib:chunks("deps/rabbit/ebin/lqueue.beam", [atoms]). ``` will parse successfully if the file gets loaded on OTP 28 irrespective of whether the file was compiled with OTP 27 or 28. However, this file fails to load if it is compiled with 28 and loaded on 27. There is the `no_long_atoms` option that we could use just for this test case. However, given that we have a similar test case two_nodes_same_otp_version we skip test case two_nodes_different_otp_version in this commit. Really, the best solution would be to use different OTP versions in RabbitMQ mixed version testing in addition to using different RabbitMQ versions. This way, the test case could just RPC into the different RabbitMQ nodes and apply the Ra commands there.
1 parent ad0c873 commit 87dac54

File tree

1 file changed

+37
-26
lines changed

1 file changed

+37
-26
lines changed

deps/rabbit/test/rabbit_fifo_prop_SUITE.erl

Lines changed: 37 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1111,32 +1111,43 @@ two_nodes_same_otp_version(Config0) ->
11111111

11121112
%% Run the log on two Erlang nodes with different OTP versions.
11131113
two_nodes_different_otp_version(_Config) ->
1114-
Node = 'rabbit_fifo_prop@localhost',
1115-
case net_adm:ping(Node) of
1116-
pong ->
1117-
case is_same_otp_version(Node) of
1118-
true ->
1119-
ct:fail("expected CT node and 'rabbit_fifo_prop@localhost' "
1120-
"to have different OTP versions");
1121-
false ->
1122-
Prefixes = ["rabbit_fifo", "rabbit_misc", "mc",
1123-
"lqueue", "priority_queue", "ra_"],
1124-
[begin
1125-
Mod = list_to_atom(ModStr),
1126-
{Mod, Bin, _File} = code:get_object_code(Mod),
1127-
{module, Mod} = erpc:call(Node, code, load_binary, [Mod, ModStr, Bin])
1128-
end
1129-
|| {ModStr, _FileName, _Loaded} <- code:all_available(),
1130-
lists:any(fun(Prefix) -> lists:prefix(Prefix, ModStr) end, Prefixes)],
1131-
two_nodes(Node)
1132-
end;
1133-
pang ->
1134-
Reason = {node_down, Node},
1135-
case rabbit_ct_helpers:is_ci() of
1136-
true ->
1137-
ct:fail(Reason);
1138-
false ->
1139-
{skip, Reason}
1114+
case erlang:system_info(otp_release) of
1115+
"28" ->
1116+
%% Compiling a BEAM file on OTP 28 and loading it on OTP 26 or 27
1117+
%% causes a "corrupt atom table" error.
1118+
%% https://github.com/erlang/otp/pull/8913#issue-2572291638
1119+
{skip, "loading BEAM file compiled on OTP 28 on a lower OTP version is unsupported"};
1120+
_ ->
1121+
Node = 'rabbit_fifo_prop@localhost',
1122+
case net_adm:ping(Node) of
1123+
pong ->
1124+
case is_same_otp_version(Node) of
1125+
true ->
1126+
ct:fail("expected CT node and 'rabbit_fifo_prop@localhost' "
1127+
"to have different OTP versions");
1128+
false ->
1129+
Prefixes = ["rabbit_fifo", "rabbit_misc", "mc",
1130+
"lqueue", "priority_queue", "ra_"],
1131+
[begin
1132+
Mod = list_to_atom(ModStr),
1133+
{Mod, Bin, _File} = code:get_object_code(Mod),
1134+
{module, Mod} = erpc:call(Node, code, load_binary,
1135+
[Mod, ModStr, Bin])
1136+
end
1137+
|| {ModStr, _FileName, _Loaded} <- code:all_available(),
1138+
lists:any(fun(Prefix) ->
1139+
lists:prefix(Prefix, ModStr)
1140+
end, Prefixes)],
1141+
two_nodes(Node)
1142+
end;
1143+
pang ->
1144+
Reason = {node_down, Node},
1145+
case rabbit_ct_helpers:is_ci() of
1146+
true ->
1147+
ct:fail(Reason);
1148+
false ->
1149+
{skip, Reason}
1150+
end
11401151
end
11411152
end.
11421153

0 commit comments

Comments
 (0)