couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fdman...@apache.org
Subject svn commit: r1143805 - /couchdb/trunk/share/www/script/test/replication.js
Date Thu, 07 Jul 2011 13:07:06 GMT
Author: fdmanana
Date: Thu Jul  7 13:07:05 2011
New Revision: 1143805

URL: http://svn.apache.org/viewvc?rev=1143805&view=rev
Log:
Fix replication.js failures in OTP < R14B03

Some assertions were failing when running CouchDB
in an OTP release older than R14B03. Explanatory
comments added to the test.


Modified:
    couchdb/trunk/share/www/script/test/replication.js

Modified: couchdb/trunk/share/www/script/test/replication.js
URL: http://svn.apache.org/viewvc/couchdb/trunk/share/www/script/test/replication.js?rev=1143805&r1=1143804&r2=1143805&view=diff
==============================================================================
--- couchdb/trunk/share/www/script/test/replication.js (original)
+++ couchdb/trunk/share/www/script/test/replication.js Thu Jul  7 13:07:05 2011
@@ -519,11 +519,28 @@ couchTests.replication = function(debug)
     }
     TEquals(2, expected_ids.length, "2 documents since since_seq");
 
+    // For OTP < R14B03, temporary child specs are kept in the supervisor
+    // after the child terminates, so cancel the replication to delete the
+    // child spec in those OTP releases, otherwise since_seq will have no
+    // effect.
+    CouchDB.replicate(
+      dbPairs[i].source,
+      dbPairs[i].target,
+      {body: {cancel: true}}
+    );
     repResult = CouchDB.replicate(
       dbPairs[i].source,
       dbPairs[i].target,
       {body: {since_seq: since_seq}}
     );
+    // Same reason as before. But here we don't want since_seq to affect
+    // subsequent replications, so we need to delete the child spec from the
+    // supervisor (since_seq is not used to calculate the replication ID).
+    CouchDB.replicate(
+      dbPairs[i].source,
+      dbPairs[i].target,
+      {body: {cancel: true}}
+    );
     TEquals(true, repResult.ok);
     TEquals(2, repResult.history[0].missing_checked);
     TEquals(2, repResult.history[0].missing_found);



Mime
View raw message