couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From beno...@apache.org
Subject svn commit: r1054234 - /couchdb/trunk/share/www/script/test/replication.js
Date Sat, 01 Jan 2011 14:37:56 GMT
Author: benoitc
Date: Sat Jan  1 14:37:55 2011
New Revision: 1054234

URL: http://svn.apache.org/viewvc?rev=1054234&view=rev
Log:
fix issue COUCHDB-1002 .


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=1054234&r1=1054233&r2=1054234&view=diff
==============================================================================
--- couchdb/trunk/share/www/script/test/replication.js (original)
+++ couchdb/trunk/share/www/script/test/replication.js Sat Jan  1 14:37:55 2011
@@ -464,6 +464,14 @@ couchTests.replication = function(debug)
     return true;
   }).toString();
 
+  function wait(ms) {
+    var t0 = new Date(), t1;
+    do {
+      CouchDB.request("GET", "/");
+      t1 = new Date();
+    } while ((t1 - t0) <= ms);
+  }
+
   var dbPairs = [
     {source:"test_suite_filtered_rep_db_a",
       target:"test_suite_filtered_rep_db_b"},
@@ -477,8 +485,13 @@ couchTests.replication = function(debug)
   var sourceDb = new CouchDB("test_suite_filtered_rep_db_a");
   var targetDb = new CouchDB("test_suite_filtered_rep_db_b");
 
+
   for (var i = 0; i < dbPairs.length; i++) {
     sourceDb.deleteDb();
+    
+    // wait some time to make sure we deleted the db.
+    // fix issue COUCHDB-1002
+    wait(1000);
     sourceDb.createDb();
 
     T(sourceDb.save({_id: "foo1", value: 1}).ok);



Mime
View raw message