aboutsummaryrefslogtreecommitdiffstats
path: root/lib/common_test
diff options
context:
space:
mode:
authorSiri Hansen <[email protected]>2016-06-05 14:04:38 +0200
committerSiri Hansen <[email protected]>2016-06-09 14:28:16 +0200
commitbaf5751951f3463d599ccb958272ab6a6fec39b4 (patch)
treea2cc37a269566e5e76425dace2e1d93559e810c6 /lib/common_test
parent12573be47139eb40ec17b137808dcde929a00345 (diff)
downloadotp-baf5751951f3463d599ccb958272ab6a6fec39b4.tar.gz
otp-baf5751951f3463d599ccb958272ab6a6fec39b4.tar.bz2
otp-baf5751951f3463d599ccb958272ab6a6fec39b4.zip
[ct test] Wait for event receiver to be unregistered
To avoid badarg when two tests are run within the same test case.
Diffstat (limited to 'lib/common_test')
-rw-r--r--lib/common_test/test/ct_test_support.erl6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/common_test/test/ct_test_support.erl b/lib/common_test/test/ct_test_support.erl
index 477fcb8a26..e926abd885 100644
--- a/lib/common_test/test/ct_test_support.erl
+++ b/lib/common_test/test/ct_test_support.erl
@@ -484,7 +484,8 @@ get_events(_, Config) ->
{event_receiver,CTNode} ! {self(),get_events},
Events = receive {event_receiver,Evs} -> Evs end,
test_server:format(Level, "Stopping event receiver!~n", []),
- {event_receiver,CTNode} ! stop,
+ {event_receiver,CTNode} ! {self(),stop},
+ receive {event_receiver,stopped} -> ok end,
Events.
er() ->
@@ -499,8 +500,9 @@ er_loop(Evs) ->
{From,get_events} ->
From ! {event_receiver,lists:reverse(Evs)},
er_loop(Evs);
- stop ->
+ {From,stop} ->
unregister(event_receiver),
+ From ! {event_receiver,stopped},
ok
end.