Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix EUnit test regression problem

In the gproc_dist_test, the receiving node of a counter update
would erroneously recalculate the aggregated counter, even though
the aggregated counter was replicated as well.
  • Loading branch information...
commit 81ff4ce6d0ea2136845e1322521f2d42820d1dfb 1 parent 4f3bbd7
@uwiger authored
Showing with 3 additions and 10 deletions.
  1. +2 −9 src/gproc_dist.erl
  2. +1 −1  test/gproc_dist_tests.erl
View
11 src/gproc_dist.erl
@@ -615,17 +615,10 @@ from_leader(Ops, S, _E) ->
insert_globals(Globals) ->
ets:insert(?TAB, Globals),
lists:foldl(
- fun({{{T,_,_} = Key,Pid}, Pid, _}, A) ->
- A1 = case T of
- c ->
- Incr = ets:lookup_element(?TAB, {Key,Pid}, 3),
- update_aggr_counter(Key, -Incr) ++ A;
- _ ->
- A
- end,
+ fun({{{_,_,_} = Key,Pid}, Pid, _}, A) ->
ets:insert_new(?TAB, {{Pid,Key}, []}),
gproc_lib:ensure_monitor(Pid,g),
- A1;
+ A;
({{{_,_,_}, n}, Pid, _}, A) ->
gproc_lib:ensure_monitor(Pid,g),
A;
View
2  test/gproc_dist_tests.erl
@@ -301,7 +301,7 @@ got_msg(Pb, Tag) ->
receive
M when element(1, M) == Tag ->
M
- after 1000 ->
+ after 5000 ->
timeout
end
end}).
Please sign in to comment.
Something went wrong with that request. Please try again.