|
@@ -1489,17 +1489,28 @@ three_nodes_update(Config) ->
|
|
|
|
|
|
%% errors
|
|
|
{error, undefined} = syn:update_registry(scope_all, "unknown", fun(_IPid, ExistingMeta) -> ExistingMeta end),
|
|
|
+ {error, {update_fun, {badarith, _}}} = syn:update_registry(scope_all, "my-proc", fun(_IPid, _IMeta) -> 1/0 end),
|
|
|
|
|
|
- %% update
|
|
|
- {ok, {Pid, {recipient, TestPid, 20}}} = syn:update_registry(
|
|
|
- scope_all,
|
|
|
- "my-proc",
|
|
|
- fun(IPid, {recipient, TestPid0, Count}) ->
|
|
|
- IPid = Pid,
|
|
|
- {recipient, TestPid0, Count * 2}
|
|
|
- end
|
|
|
+ %% retrieve
|
|
|
+ syn_test_suite_helper:assert_wait(
|
|
|
+ {Pid, {recipient, TestPid, 10}},
|
|
|
+ fun() -> syn:lookup(scope_all, "my-proc") end
|
|
|
+ ),
|
|
|
+ syn_test_suite_helper:assert_wait(
|
|
|
+ {Pid, {recipient, TestPid, 10}},
|
|
|
+ fun() -> rpc:call(SlaveNode1, syn, lookup, [scope_all, "my-proc"]) end
|
|
|
+ ),
|
|
|
+ syn_test_suite_helper:assert_wait(
|
|
|
+ {Pid, {recipient, TestPid, 10}},
|
|
|
+ fun() -> rpc:call(SlaveNode2, syn, lookup, [scope_all, "my-proc"]) end
|
|
|
),
|
|
|
|
|
|
+ %% update
|
|
|
+ {ok, {Pid, {recipient, TestPid, 20}}} = syn:update_registry(scope_all, "my-proc", fun(IPid, {recipient, TestPid0, Count}) ->
|
|
|
+ IPid = Pid,
|
|
|
+ {recipient, TestPid0, Count * 2}
|
|
|
+ end),
|
|
|
+
|
|
|
%% retrieve
|
|
|
syn_test_suite_helper:assert_wait(
|
|
|
{Pid, {recipient, TestPid, 20}},
|
|
@@ -1532,13 +1543,9 @@ three_nodes_update(Config) ->
|
|
|
]),
|
|
|
|
|
|
%% update on remote
|
|
|
- {ok, {PidOn1, {recipient, TestPid, 1001}}} = syn:update_registry(
|
|
|
- scope_all,
|
|
|
- "my-proc-on-1",
|
|
|
- fun(_IPid, {recipient, TestPid0, Count}) ->
|
|
|
- {recipient, TestPid0, Count + 1}
|
|
|
- end
|
|
|
- ),
|
|
|
+ {ok, {PidOn1, {recipient, TestPid, 1001}}} = syn:update_registry(scope_all, "my-proc-on-1", fun(_IPid, {recipient, TestPid0, Count}) ->
|
|
|
+ {recipient, TestPid0, Count + 1}
|
|
|
+ end),
|
|
|
|
|
|
%% retrieve
|
|
|
syn_test_suite_helper:assert_wait(
|