summaryrefslogtreecommitdiff
path: root/src/mem3
diff options
context:
space:
mode:
Diffstat (limited to 'src/mem3')
-rw-r--r--src/mem3/src/mem3_sync_event_listener.erl14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/mem3/src/mem3_sync_event_listener.erl b/src/mem3/src/mem3_sync_event_listener.erl
index b6fbe3279..cad34225d 100644
--- a/src/mem3/src/mem3_sync_event_listener.erl
+++ b/src/mem3/src/mem3_sync_event_listener.erl
@@ -236,7 +236,7 @@ teardown_all(_) ->
setup() ->
{ok, Pid} = ?MODULE:start_link(),
erlang:unlink(Pid),
- meck:wait(config_notifier, subscribe, '_', 1000),
+ wait_config_subscribed(Pid),
Pid.
teardown(Pid) ->
@@ -338,4 +338,16 @@ wait_state(Pid, Field, Val) when is_pid(Pid), is_integer(Field) ->
end,
test_util:wait(WaitFun).
+
+wait_config_subscribed(Pid) ->
+ WaitFun = fun() ->
+ Handlers = gen_event:which_handlers(config_event),
+ Pids = [Id || {config_notifier, Id} <- Handlers],
+ case lists:member(Pid, Pids) of
+ true -> true;
+ false -> wait
+ end
+ end,
+ test_util:wait(WaitFun).
+
-endif.