aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRickard Green <[email protected]>2019-07-05 15:44:46 +0200
committerRickard Green <[email protected]>2019-07-08 11:08:43 +0200
commit18a5032e06eebbb6870489bd6d89d495175297ec (patch)
treededb9251933815700a26d66d18cd6159d693bc7c
parent1651bd5f6053c73129a38b6df5a8a130d2564e5b (diff)
downloadotp-18a5032e06eebbb6870489bd6d89d495175297ec.tar.gz
otp-18a5032e06eebbb6870489bd6d89d495175297ec.tar.bz2
otp-18a5032e06eebbb6870489bd6d89d495175297ec.zip
Fix unstable node_container_SUITE:magic_ref test
-rw-r--r--erts/emulator/test/node_container_SUITE.erl17
1 files changed, 16 insertions, 1 deletions
diff --git a/erts/emulator/test/node_container_SUITE.erl b/erts/emulator/test/node_container_SUITE.erl
index d77d442ef0..ad19fb7c08 100644
--- a/erts/emulator/test/node_container_SUITE.erl
+++ b/erts/emulator/test/node_container_SUITE.erl
@@ -894,7 +894,22 @@ magic_ref(Config) when is_list(Config) ->
{'DOWN', Mon, process, Pid, _} ->
ok
end,
- {Addr0, 2, true} = erts_debug:get_internal_state({magic_ref,MRef0}),
+ MaxTime = erlang:monotonic_time(millisecond) + 1000,
+ %% The DOWN signal is sent before heap is cleaned up,
+ %% so we might need to wait some time after the DOWN
+ %% signal has been received before the heap actually
+ %% has been cleaned up...
+ wait_until(fun () ->
+ case erts_debug:get_internal_state({magic_ref,MRef0}) of
+ {Addr0, 2, true} ->
+ true;
+ {Addr0, 3, true} ->
+ true = MaxTime >= erlang:monotonic_time(millisecond),
+ false;
+ Error ->
+ ct:fail(Error)
+ end
+ end),
id(MRef0),
id(MRef1),
MRefExt = term_to_binary(erts_debug:set_internal_state(make, magic_ref)),