aboutsummaryrefslogtreecommitdiffstats
path: root/erts
diff options
context:
space:
mode:
authorLukas Larsson <[email protected]>2019-01-07 17:18:36 +0100
committerLukas Larsson <[email protected]>2019-01-07 17:18:36 +0100
commit5558739ec463bf20e8b7e57be9a0351d4f3e3933 (patch)
treebccb52271433aa996c3b2ac25939c686e3a5e048 /erts
parenteed24f53c0565a3dec351116ac9296cc64d89f2d (diff)
downloadotp-5558739ec463bf20e8b7e57be9a0351d4f3e3933.tar.gz
otp-5558739ec463bf20e8b7e57be9a0351d4f3e3933.tar.bz2
otp-5558739ec463bf20e8b7e57be9a0351d4f3e3933.zip
erts: Fix process_SUITE:max_heap tests
Make sure to flush all queued emulator logger messages before starting the test. The trap_exit_badarg could sometimes leave messages and since the handler and messages now are handled in different processes this becomes a problem.
Diffstat (limited to 'erts')
-rw-r--r--erts/emulator/test/process_SUITE.erl14
1 files changed, 14 insertions, 0 deletions
diff --git a/erts/emulator/test/process_SUITE.erl b/erts/emulator/test/process_SUITE.erl
index 57eb082d64..b23f77a0b2 100644
--- a/erts/emulator/test/process_SUITE.erl
+++ b/erts/emulator/test/process_SUITE.erl
@@ -2104,6 +2104,13 @@ spawn_opt_max_heap_size(_Config) ->
error_logger:add_report_handler(?MODULE, self()),
+ %% flush any prior messages in error_logger
+ Pid = spawn(fun() -> ok = nok end),
+ receive
+ {error, _, {emulator, _, [Pid|_]}} ->
+ flush()
+ end,
+
%% Test that numerical limit works
max_heap_size_test(1024, 1024, true, true),
@@ -2208,6 +2215,13 @@ receive_unexpected() ->
ok
end.
+flush() ->
+ receive
+ _M -> flush()
+ after 0 ->
+ ok
+ end.
+
%% error_logger report handler proxy
init(Pid) ->
{ok, Pid}.