diff options
author | Rickard Green <[email protected]> | 2019-07-22 11:36:49 +0200 |
---|---|---|
committer | Rickard Green <[email protected]> | 2019-07-22 11:36:49 +0200 |
commit | bcffb7f5599efb62f13128e6feeb03a65cd9c11e (patch) | |
tree | 727817f9c55bedc98ab8d8bb71df5262a244a308 /erts/emulator/test | |
parent | 993139cdbe67523027aa69ec8542d32dd99d4b77 (diff) | |
parent | bf72b2e9f1239337764955bd633af46149b6c3d6 (diff) | |
download | otp-bcffb7f5599efb62f13128e6feeb03a65cd9c11e.tar.gz otp-bcffb7f5599efb62f13128e6feeb03a65cd9c11e.tar.bz2 otp-bcffb7f5599efb62f13128e6feeb03a65cd9c11e.zip |
Merge branch 'rickard/node-refc-tests-22' into maint
* rickard/node-refc-tests-22:
Fix etp-ets-tables
Fix node refc test for free processes hanging around
Enhanced node refc bookkeeping
Fix node container refc tests of ETS
Fix node refc test of external data
Node container refc test for persistent terms
Include persistent term storage in node/dist refc check
Fix node refc test for system message queue
Diffstat (limited to 'erts/emulator/test')
-rw-r--r-- | erts/emulator/test/node_container_SUITE.erl | 44 |
1 files changed, 42 insertions, 2 deletions
diff --git a/erts/emulator/test/node_container_SUITE.erl b/erts/emulator/test/node_container_SUITE.erl index 7d2db5257c..c44693f8d9 100644 --- a/erts/emulator/test/node_container_SUITE.erl +++ b/erts/emulator/test/node_container_SUITE.erl @@ -51,7 +51,8 @@ unique_pid/1, iter_max_procs/1, magic_ref/1, - dist_entry_gc/1]). + dist_entry_gc/1, + persistent_term/1]). suite() -> [{ct_hooks,[ts_install_cth]}, @@ -63,7 +64,8 @@ all() -> node_table_gc, dist_link_refc, dist_monitor_refc, node_controller_refc, ets_refc, match_spec_refc, timer_refc, pid_wrap, port_wrap, bad_nc, - unique_pid, iter_max_procs, magic_ref]. + unique_pid, iter_max_procs, + magic_ref, persistent_term]. init_per_suite(Config) -> Config. @@ -906,6 +908,44 @@ magic_ref(Config) when is_list(Config) -> true = erts_debug:get_internal_state({magic_ref,MRef2}), ok. +persistent_term(Config) when is_list(Config) -> + {ok, Node} = start_node(get_nodefirstname()), + Self = self(), + NcData = make_ref(), + RPid = spawn_link(Node, + fun () -> + Self ! {NcData, self(), hd(erlang:ports()), erlang:make_ref()} + end), + Data = receive + {NcData, RPid, RPort, RRef} -> + {RPid, RPort, RRef} + end, + unlink(RPid), + stop_node(Node), + Stuff = lists:foldl(fun (N, Acc) -> + persistent_term:put({?MODULE, N}, Data), + persistent_term:erase({?MODULE, N-1}), + node_container_refc_check(node()), + Data = persistent_term:get({?MODULE, N}), + try + persistent_term:get({?MODULE, N-1}) + catch + error:badarg -> + ok + end, + case N rem 4 of + 0 -> [persistent_term:get({?MODULE, N})|Acc]; + _ -> Acc + end + end, + [], + lists:seq(1, 100)), + persistent_term:erase({?MODULE, 100}), + receive after 2000 -> ok end, %% give literal gc some time to run... + node_container_refc_check(node()), + id(Stuff), + ok. + lost_pending_connection(Node) -> _ = (catch erts_internal:new_connection(Node)), |