Skip to content

Commit

Permalink
fix issue COUCHDB-1002 .
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@1054234 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
Benoit Chesneau committed Jan 1, 2011
1 parent a777195 commit 8269f79
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions share/www/script/test/replication.js
Original file line number Diff line number Diff line change
Expand Up @@ -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"},
Expand All @@ -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);
Expand Down

0 comments on commit 8269f79

Please sign in to comment.