couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dav...@apache.org
Subject svn commit: r925286 - in /couchdb/branches/0.11.x: ./ etc/default/couchdb test/etap/100-ref-counter.t
Date Fri, 19 Mar 2010 15:43:31 GMT
Author: davisp
Date: Fri Mar 19 15:43:30 2010
New Revision: 925286

URL: http://svn.apache.org/viewvc?rev=925286&view=rev
Log:
Backport the fix for 100-ref-counter.t - 925264


Modified:
    couchdb/branches/0.11.x/   (props changed)
    couchdb/branches/0.11.x/etc/default/couchdb   (props changed)
    couchdb/branches/0.11.x/test/etap/100-ref-counter.t

Propchange: couchdb/branches/0.11.x/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Mar 19 15:43:30 2010
@@ -6,4 +6,4 @@
 /couchdb/branches/list-iterator:782292-784593
 /couchdb/branches/tail_header:775760-778477
 /couchdb/tags/0.10.0:825400
-/couchdb/trunk:909247,910054,910696,910910-910911,911544,911559,911578,911602,911717,911837,912474,912606,912608,912615,912636,915526,915529-915530,915827,916076,916153,916518,916521,917553,918855,919193,921707,923526
+/couchdb/trunk:909247,910054,910696,910910-910911,911544,911559,911578,911602,911717,911837,912474,912606,912608,912615,912636,915526,915529-915530,915827,916076,916153,916518,916521,917553,918855,919193,921707,923526,925264

Propchange: couchdb/branches/0.11.x/etc/default/couchdb
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Mar 19 15:43:30 2010
@@ -6,5 +6,5 @@
 /couchdb/branches/list-iterator/etc/default/couchdb:782292-784593
 /couchdb/branches/tail_header/etc/default/couchdb:775760-778477
 /couchdb/tags/0.10.0/etc/default/couchdb:825400
-/couchdb/trunk/etc/default/couchdb:909247,910054,910696,911544,911602,911717,911837,912474,912606,912608,912615,912636,915526,915529-915530,915827,916076,916153,916518,916521,917553,918855,919193,921707,923526
+/couchdb/trunk/etc/default/couchdb:909247,910054,910696,911544,911602,911717,911837,912474,912606,912608,912615,912636,915526,915529-915530,915827,916076,916153,916518,916521,917553,918855,919193,921707,923526,925264
 /incubator/couchdb/trunk/etc/default/couchdb:642419-694440

Modified: couchdb/branches/0.11.x/test/etap/100-ref-counter.t
URL: http://svn.apache.org/viewvc/couchdb/branches/0.11.x/test/etap/100-ref-counter.t?rev=925286&r1=925285&r2=925286&view=diff
==============================================================================
--- couchdb/branches/0.11.x/test/etap/100-ref-counter.t (original)
+++ couchdb/branches/0.11.x/test/etap/100-ref-counter.t Fri Mar 19 15:43:30 2010
@@ -27,17 +27,14 @@ main(_) ->
 
 loop() ->
     receive
-    {ping, From} ->
-        From ! pong
+        close -> ok
     end.
 
 wait() ->
     receive
-        _ ->
-            ok
-    after
-        1000 ->
-            throw(timeout_error)
+        {'DOWN', _, _, _, _} -> ok
+    after 1000 ->
+        throw(timeout_error)
     end.
 
 test() ->
@@ -94,11 +91,23 @@ test() ->
         "Sanity checking that the Pid was re-added."
     ),
 
-    ChildPid1 ! {ping, self()},
+    erlang:monitor(process, ChildPid1),
+    ChildPid1 ! close,
     wait(),
-    etap:is(
-        couch_ref_counter:count(RefCtr),
-        1,
+    
+    CheckFun = fun
+        (Iter, nil) ->
+            case couch_ref_counter:count(RefCtr) of
+                1 -> Iter;
+                _ -> nil
+            end;
+        (_, Acc) ->
+            Acc
+    end,
+    Result = lists:foldl(CheckFun, nil, lists:seq(1, 10000)),
+    etap:isnt(
+        Result,
+        nil,
         "The referer count was decremented automatically on process exit."
     ),
 



Mime
View raw message