diff options
author | Jan Lehnardt <jan@apache.org> | 2012-11-13 19:07:22 +0100 |
---|---|---|
committer | Jan Lehnardt <jan@apache.org> | 2012-11-13 19:07:22 +0100 |
commit | 5316647be17913ec0d9d7166368bffc13f8aaf01 (patch) | |
tree | 2f033cbcc4639f2654c2c2a48317cb980ce9feb6 | |
parent | 41667642f73fc19785bd18d6140a707c36544972 (diff) | |
download | couchdb-5316647be17913ec0d9d7166368bffc13f8aaf01.tar.gz |
Work around race conditions in tests on faster hardware.
THIS NEEDS A PROPER FIX.
-rw-r--r-- | share/www/script/test/replication.js | 1 | ||||
-rw-r--r-- | share/www/script/test/users_db_security.js | 8 |
2 files changed, 9 insertions, 0 deletions
diff --git a/share/www/script/test/replication.js b/share/www/script/test/replication.js index f54ffff21..2b23af5f2 100644 --- a/share/www/script/test/replication.js +++ b/share/www/script/test/replication.js @@ -97,6 +97,7 @@ couchTests.replication = function(debug) { function populateDb(db, docs, dontRecreateDb) { if (dontRecreateDb !== true) { db.deleteDb(); + wait(100); db.createDb(); } for (var i = 0; i < docs.length; i++) { diff --git a/share/www/script/test/users_db_security.js b/share/www/script/test/users_db_security.js index f8a9d5c5e..d439fcbfa 100644 --- a/share/www/script/test/users_db_security.js +++ b/share/www/script/test/users_db_security.js @@ -14,6 +14,13 @@ couchTests.users_db_security = function(debug) { var usersDb = new CouchDB("test_suite_users", {"X-Couch-Full-Commit":"false"}); if (debug) debugger; + function wait(ms) { + var t0 = new Date(), t1; + do { + CouchDB.request("GET", "/"); + t1 = new Date(); + } while ((t1 - t0) <= ms); + } var loginUser = function(username) { var pws = { @@ -133,6 +140,7 @@ couchTests.users_db_security = function(debug) { jchrisDoc.password = "couch"; TEquals(true, save_as(usersDb, jchrisDoc, "jchris").ok); + wait(100); var jchrisDoc = open_as(usersDb, "org.couchdb.user:jchris", "jchris1"); TEquals(undefined, jchrisDoc.password, "password field should be null 2"); |