Browse Source

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.
Ulf Wiger 12 years ago
parent
commit
81ff4ce6d0
2 changed files with 3 additions and 10 deletions
  1. 2 9
      src/gproc_dist.erl
  2. 1 1
      test/gproc_dist_tests.erl

+ 2 - 9
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;

+ 1 - 1
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}).