From 1bb171a7c27fcb79435a915bac834a4013b5f0dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= Date: Thu, 1 Jun 2017 07:29:23 +0200 Subject: Contain damage cause by spawn_opt_max_heap_size failing If process_SUITE:spawn_opt_max_heap_size/1 failed, the default value for the maximum heap size could have been changed. That would cause other test cases that spawned huge processes to fail. Contain the damage by always restoring the default value for max_heap_size in end_per_testcase/2. --- erts/emulator/test/process_SUITE.erl | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'erts/emulator') diff --git a/erts/emulator/test/process_SUITE.erl b/erts/emulator/test/process_SUITE.erl index a65c3f0cad..180311202f 100644 --- a/erts/emulator/test/process_SUITE.erl +++ b/erts/emulator/test/process_SUITE.erl @@ -134,6 +134,11 @@ init_per_testcase(Func, Config) when is_atom(Func), is_list(Config) -> [{testcase, Func}|Config]. end_per_testcase(Func, Config) when is_atom(Func), is_list(Config) -> + %% Restore max_heap_size to default value. + erlang:system_flag(max_heap_size, + #{size => 0, + kill => true, + error_logger => true}), ok. fun_spawn(Fun) -> -- cgit v1.2.3