File 0562-inline_SUITE-Don-t-start-a-slave-node.patch of Package erlang

From bb94f0d1b39fd4d00f73b6094be4cb6a4b074dac Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= <bjorn@erlang.org>
Date: Fri, 1 Feb 2019 05:26:40 +0100
Subject: [PATCH 5/5] inline_SUITE: Don't start a slave node

A long time ago there was a good idea to run compiled code in a
slave node. Nowadays, not so much.
---
 lib/compiler/test/inline_SUITE.erl              | 26 ++++++++++---------------
 lib/compiler/test/inline_SUITE_data/barnes2.erl |  2 +-
 2 files changed, 11 insertions(+), 17 deletions(-)

diff --git a/lib/compiler/test/inline_SUITE.erl b/lib/compiler/test/inline_SUITE.erl
index 69c9dcba69..f700059d20 100644
--- a/lib/compiler/test/inline_SUITE.erl
+++ b/lib/compiler/test/inline_SUITE.erl
@@ -42,13 +42,9 @@ groups() ->
        coverage]}].
 
 init_per_suite(Config) ->
-    Pa = "-pa " ++ filename:dirname(code:which(?MODULE)),
-    {ok,Node} = start_node(compiler, Pa),
-    [{testing_node,Node}|Config].
+    Config.
 
-end_per_suite(Config) ->
-    Node = proplists:get_value(testing_node, Config),
-    test_server:stop_node(Node),
+end_per_suite(_Config) ->
     ok.
 
 init_per_group(_GroupName, Config) ->
@@ -89,7 +85,6 @@ attribute(Config) when is_list(Config) ->
 ?comp(maps_inline_test).
 
 try_inline(Mod, Config) ->
-    Node = proplists:get_value(testing_node, Config),
     Src = filename:join(proplists:get_value(data_dir, Config),
 			atom_to_list(Mod)),
     Out = proplists:get_value(priv_dir,Config),
@@ -100,7 +95,7 @@ try_inline(Mod, Config) ->
     {ok,Mod} = compile:file(Src, [{outdir,Out},report,bin_opt_info,clint]),
 
     ct:timetrap({minutes,10}),
-    NormalResult = rpc:call(Node, ?MODULE, load_and_call, [Out,Mod]),
+    NormalResult = load_and_call(Out, Mod),
 
     %% Inlining.
     io:format("Compiling with old inliner: ~s\n", [Src]),
@@ -109,7 +104,7 @@ try_inline(Mod, Config) ->
 
     %% Run inlined code.
     ct:timetrap({minutes,10}),
-    OldInlinedResult = rpc:call(Node, ?MODULE, load_and_call, [Out,Mod]),
+    OldInlinedResult = load_and_call(Out, Mod),
 
     %% Compare results.
     compare(NormalResult, OldInlinedResult),
@@ -122,7 +117,7 @@ try_inline(Mod, Config) ->
 
     %% Run inlined code.
     ct:timetrap({minutes,10}),
-    InlinedResult = rpc:call(Node, ?MODULE, load_and_call, [Out,Mod]),
+    InlinedResult = load_and_call(Out, Mod),
 
     %% Compare results.
     compare(NormalResult, InlinedResult),
@@ -131,6 +126,11 @@ try_inline(Mod, Config) ->
     %% Delete Beam file.
     ok = file:delete(filename:join(Out, atom_to_list(Mod)++code:objfile_extension())),
 
+    %% Delete loaded module.
+    _ = code:purge(Mod),
+    _ = code:delete(Mod),
+    _ = code:purge(Mod),
+
     ok.
 
 compare(Same, Same) -> ok;
@@ -144,12 +144,6 @@ compare([H1|_], [H2|_]) ->
     ct:fail(different);
 compare([], []) -> ok.
 
-start_node(Name, Args) ->
-    case test_server:start_node(Name, slave, [{args,Args}]) of
-	{ok,Node} -> {ok, Node};
-	Error  -> ct:fail(Error)
-    end.
-
 load_and_call(Out, Module) ->
     io:format("Loading...\n",[]),
     code:purge(Module),
diff --git a/lib/compiler/test/inline_SUITE_data/barnes2.erl b/lib/compiler/test/inline_SUITE_data/barnes2.erl
index a986331060..49e9bdfb6b 100644
--- a/lib/compiler/test/inline_SUITE_data/barnes2.erl
+++ b/lib/compiler/test/inline_SUITE_data/barnes2.erl
@@ -6,7 +6,7 @@
 ?MODULE() ->
     Stars = create_scenario(1000, 1.0),
     R = hd(loop(10,1000.0,Stars,0)),
-    Str = lists:flatten(io:lib_format("~s", [R])),
+    Str = lists:flatten(io_lib:format("~p", [R])),
     {R,Str =:= {1.00000,-1.92269e+4,-1.92269e+4,2.86459e-2,2.86459e-2}}.
 
 create_scenario(N, M) ->
-- 
2.16.4