From 3136c77b2e8e2801343558d6c79b4a7cb9d06117 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= Date: Thu, 10 May 2012 16:05:08 +0200 Subject: Remove workarounds for hybrid and shared heaps in test suites --- erts/emulator/test/binary_SUITE.erl | 9 +-------- erts/emulator/test/bs_construct_SUITE.erl | 8 -------- erts/emulator/test/code_SUITE.erl | 25 ++++++------------------- erts/emulator/test/fun_SUITE.erl | 18 ------------------ erts/emulator/test/hibernate_SUITE.erl | 10 ++-------- erts/emulator/test/node_container_SUITE.erl | 16 +--------------- erts/emulator/test/port_SUITE.erl | 6 +++--- 7 files changed, 13 insertions(+), 79 deletions(-) (limited to 'erts/emulator/test') diff --git a/erts/emulator/test/binary_SUITE.erl b/erts/emulator/test/binary_SUITE.erl index d9fc876482..c9f43bb00b 100644 --- a/erts/emulator/test/binary_SUITE.erl +++ b/erts/emulator/test/binary_SUITE.erl @@ -1135,15 +1135,8 @@ sleeper() -> ?line receive after infinity -> ok end. -gc_test(doc) -> "Test that binaries are garbage collected properly."; -gc_test(suite) -> []; +%% Test that binaries are garbage collected properly. gc_test(Config) when is_list(Config) -> - case erlang:system_info(heap_type) of - private -> gc_test_1(); - hybrid -> {skip,"Hybrid heap"} - end. - -gc_test_1() -> %% Note: This test is only relevant for REFC binaries. %% Therefore, we take care that all binaries are REFC binaries. B = list_to_binary(lists:seq(0, ?heap_binary_size)), diff --git a/erts/emulator/test/bs_construct_SUITE.erl b/erts/emulator/test/bs_construct_SUITE.erl index 7fdf36711b..dea02b1f4b 100644 --- a/erts/emulator/test/bs_construct_SUITE.erl +++ b/erts/emulator/test/bs_construct_SUITE.erl @@ -460,7 +460,6 @@ mem_leak(0, _) -> ok; mem_leak(N, B) -> ?line big_bin(B, <<23>>), ?line {'EXIT',{badarg,_}} = (catch big_bin(B, bad)), - maybe_gc(), mem_leak(N-1, B). big_bin(B1, B2) -> @@ -473,13 +472,6 @@ big_bin(B1, B2) -> make_bin(0, Acc) -> Acc; make_bin(N, Acc) -> make_bin(N-1, <>). -maybe_gc() -> - case erlang:system_info(heap_type) of - shared -> erlang:garbage_collect(); - hybrid -> erlang:garbage_collect(); - private -> ok - end. - -define(COF(Int0), ?line (fun(Int) -> true = <> =:= <<(float(Int)):32/float>>, diff --git a/erts/emulator/test/code_SUITE.erl b/erts/emulator/test/code_SUITE.erl index 25ce94096f..74ce5e397a 100644 --- a/erts/emulator/test/code_SUITE.erl +++ b/erts/emulator/test/code_SUITE.erl @@ -135,14 +135,7 @@ new_binary_types(Config) when is_list(Config) -> bit_sized_binary(Bin))), ok. -t_check_process_code(doc) -> "Test check_process_code/2."; t_check_process_code(Config) when is_list(Config) -> - case erlang:system_info(heap_type) of - private -> t_check_process_code_1(Config); - hybrid -> {skip,"Hybrid heap"} - end. - -t_check_process_code_1(Config) -> ?line Priv = ?config(priv_dir, Config), ?line Data = ?config(data_dir, Config), ?line File = filename:join(Data, "my_code_test"), @@ -247,12 +240,10 @@ gc1() -> ok. t_check_process_code_ets(doc) -> "Test check_process_code/2 in combination with a fun obtained from an ets table."; t_check_process_code_ets(Config) when is_list(Config) -> - case {test_server:is_native(?MODULE),erlang:system_info(heap_type)} of - {true,_} -> - {skipped,"Native code"}; - {_,hybrid} -> - {skipped,"Hybrid heap"}; - {false,private} -> + case test_server:is_native(?MODULE) of + true -> + {skip,"Native code"}; + false -> do_check_process_code_ets(Config) end. @@ -397,9 +388,7 @@ module_md5_ok(Code) -> make_stub(Config) when is_list(Config) -> - %% No old code to purge if hybrid heap because of skipped test cases, - %% so we'll need a catch here. - ?line (catch erlang:purge_module(my_code_test)), + catch erlang:purge_module(my_code_test), ?line Data = ?config(data_dir, Config), ?line File = filename:join(Data, "my_code_test"), @@ -433,9 +422,7 @@ make_stub(Config) when is_list(Config) -> ok. make_stub_many_funs(Config) when is_list(Config) -> - %% No old code to purge if hybrid heap because of skipped test cases, - %% so we'll need a catch here. - ?line (catch erlang:purge_module(many_funs)), + catch erlang:purge_module(many_funs), ?line Data = ?config(data_dir, Config), ?line File = filename:join(Data, "many_funs"), diff --git a/erts/emulator/test/fun_SUITE.erl b/erts/emulator/test/fun_SUITE.erl index 559e540016..839ad6a4f4 100644 --- a/erts/emulator/test/fun_SUITE.erl +++ b/erts/emulator/test/fun_SUITE.erl @@ -539,12 +539,6 @@ bad_md5(Bad) -> {'EXIT',{badarg,_}} = (catch erlang:md5(Bad)). refc(Config) when is_list(Config) -> - case erlang:system_info(heap_type) of - private -> refc_1(); - hybrid -> {skip,"Hybrid heap"} - end. - -refc_1() -> ?line F1 = fun_factory(2), ?line {refc,2} = erlang:fun_info(F1, refc), ?line F2 = fun_factory(42), @@ -570,12 +564,6 @@ fun_factory(Const) -> fun(X) -> X + Const end. refc_ets(Config) when is_list(Config) -> - case erlang:system_info(heap_type) of - private -> refc_ets_1(); - hybrid -> {skip,"Hybrid heap"} - end. - -refc_ets_1() -> ?line F = fun(X) -> X + 33 end, ?line {refc,2} = erlang:fun_info(F, refc), @@ -622,12 +610,6 @@ refc_ets_bag(F1, Options) -> ok. refc_dist(Config) when is_list(Config) -> - case erlang:system_info(heap_type) of - private -> refc_dist_1(); - hybrid -> {skip,"Hybrid heap"} - end. - -refc_dist_1() -> ?line {ok,Node} = start_node(fun_SUITE_refc_dist), ?line process_flag(trap_exit, true), ?line Pid = spawn_link(Node, diff --git a/erts/emulator/test/hibernate_SUITE.erl b/erts/emulator/test/hibernate_SUITE.erl index 82a0aad189..68bc3434d4 100644 --- a/erts/emulator/test/hibernate_SUITE.erl +++ b/erts/emulator/test/hibernate_SUITE.erl @@ -67,10 +67,7 @@ end_per_testcase(_Func, Config) -> basic(Config) when is_list(Config) -> Ref = make_ref(), Info = {self(),Ref}, - ExpectedHeapSz = case erlang:system_info(heap_type) of - private -> erts_debug:size([Info]); - hybrid -> erts_debug:size([a|b]) - end, + ExpectedHeapSz = erts_debug:size([Info]), ?line Child = spawn_link(fun() -> basic_hibernator(Info) end), ?line hibernate_wake_up(100, ExpectedHeapSz, Child), ?line Child ! please_quit_now, @@ -166,10 +163,7 @@ whats_up_calc(A1, A2, A3, A4, A5, A6, A7, A8, A9, Acc) -> dynamic_call(Config) when is_list(Config) -> Ref = make_ref(), Info = {self(),Ref}, - ExpectedHeapSz = case erlang:system_info(heap_type) of - private -> erts_debug:size([Info]); - hybrid -> erts_debug:size([a|b]) - end, + ExpectedHeapSz = erts_debug:size([Info]), ?line Child = spawn_link(fun() -> ?MODULE:dynamic_call_hibernator(Info, hibernate) end), ?line hibernate_wake_up(100, ExpectedHeapSz, Child), ?line Child ! please_quit_now, diff --git a/erts/emulator/test/node_container_SUITE.erl b/erts/emulator/test/node_container_SUITE.erl index aa83459ef8..0bf2c03233 100644 --- a/erts/emulator/test/node_container_SUITE.erl +++ b/erts/emulator/test/node_container_SUITE.erl @@ -459,10 +459,6 @@ make_node_garbage(_, _, _, Ps) -> end, lists:foreach(fun (P) -> wait_until(fun () -> ProcIsCleanedUp(P) end) end, Ps), - ?line case erlang:system_info(heap_type) of - shared -> ?line garbage_collect(); - _ -> ?line ok - end, ?line ok. @@ -605,17 +601,7 @@ node_controller_refc(Config) when is_list(Config) -> % Get rid of all references to Node ?line exec(P, fun () -> exit(normal) end), ?line wait_until(fun () -> not is_process_alive(P) end), - ?line case erlang:system_info(heap_type) of - shared -> - ?line garbage_collect(); - hybrid -> - ?line lists:foreach(fun (Proc) -> garbage_collect(Proc) end, - processes()), - ?line erlang:garbage_collect_message_area(); - _ -> - ?line lists:foreach(fun (Proc) -> garbage_collect(Proc) end, - processes()) - end, + lists:foreach(fun (Proc) -> garbage_collect(Proc) end, processes()), ?line false = get_node_references({Node,Creation}), ?line false = get_dist_references(Node), ?line false = lists:member(Node, nodes(known)), diff --git a/erts/emulator/test/port_SUITE.erl b/erts/emulator/test/port_SUITE.erl index 0a1ef5a78f..0b99b3438a 100644 --- a/erts/emulator/test/port_SUITE.erl +++ b/erts/emulator/test/port_SUITE.erl @@ -1244,8 +1244,8 @@ otp_3906_forker(N, Parent, Ref, Sup, Prog) -> otp_4389(suite) -> []; otp_4389(doc) -> []; otp_4389(Config) when is_list(Config) -> - case {os:type(),erlang:system_info(heap_type)} of - {{unix, _},private} -> + case os:type() of + {unix, _} -> ?line Dog = test_server:timetrap(test_server:seconds(240)), ?line TCR = self(), case get_true_cmd() of @@ -1293,7 +1293,7 @@ otp_4389(Config) when is_list(Config) -> ?line {skipped, "\"true\" command not found"} end; _ -> - {skip,"Only run on Unix and private heaps"} + {skip,"Only run on Unix"} end. get_true_cmd() -> -- cgit v1.2.3