diff options
author | Damien F. Katz <damien@apache.org> | 2010-04-02 23:17:02 +0000 |
---|---|---|
committer | Damien F. Katz <damien@apache.org> | 2010-04-02 23:17:02 +0000 |
commit | 8897dbe40941295009d156bf77eb0bf40abc5136 (patch) | |
tree | 46c2d859e2baa93190f4c8757f8ffa880de2f07f /share/www/script/test/oauth.js | |
parent | 776b36073865dc66a7834beabf3074b32d9669a1 (diff) |
Removed _sleep from all tests. replaced with loops that spin until a condition is true. Makes tests faster and less likely to fail sporadically.
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@930430 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'share/www/script/test/oauth.js')
-rw-r--r-- | share/www/script/test/oauth.js | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/share/www/script/test/oauth.js b/share/www/script/test/oauth.js index 55f2f430..62782853 100644 --- a/share/www/script/test/oauth.js +++ b/share/www/script/test/oauth.js @@ -94,8 +94,17 @@ couchTests.oauth = function(debug) { headers: {"X-Couch-Persist": "false"}, body: JSON.stringify(testadminPassword) }); - - CouchDB.request("GET", "/_sleep?time=50"); + while (true) { + //loop until the couch server has processed the password + var xhr = CouchDB.request("GET", "http://" + host + "/_config/admins/testadmin?foo="+i,{ + headers: { + "Authorization": adminBasicAuthHeaderValue() + }}) + if (xhr.responseText.indexOf("\"-hashed-") == 0) { + break; + } + console.log("foo:" + xhr.responseText) + } CouchDB.newUuids(2); // so we have one to make the salt |