You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by ja...@apache.org on 2018/03/29 17:37:41 UTC

[couchdb] branch master updated: Make loginUser wait for successful authentication

This is an automated email from the ASF dual-hosted git repository.

jan pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/couchdb.git


The following commit(s) were added to refs/heads/master by this push:
     new 6ffe042  Make loginUser wait for successful authentication
6ffe042 is described below

commit 6ffe0421ac524138a6b48fd010f2540631b83d16
Author: Eric Avdey <ei...@eiri.ca>
AuthorDate: Thu Mar 29 13:44:29 2018 -0300

    Make loginUser wait for successful authentication
---
 test/javascript/tests/users_db_security.js | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/test/javascript/tests/users_db_security.js b/test/javascript/tests/users_db_security.js
index 4cc154e..c55c764 100644
--- a/test/javascript/tests/users_db_security.js
+++ b/test/javascript/tests/users_db_security.js
@@ -32,7 +32,13 @@ couchTests.users_db_security = function(debug) {
     // the actual tests
     var username1 = username.replace(/[0-9]$/, "");
     var password = pws[username];
-    T(CouchDB.login(username1, pws[username]).ok);
+    waitForSuccess(function() {
+      var req = CouchDB.login(username1, pws[username]);
+      if (req.ok) {
+        return true
+      }
+      throw({});
+    }, 'loginUser');
   };
 
   var open_as = function(db, docId, username) {
@@ -107,7 +113,6 @@ couchTests.users_db_security = function(debug) {
 
     // jan's gonna be admin as he's the first user
     TEquals(true, usersDb.save(userDoc).ok, "should save document");
-    wait(5000);
     userDoc = open_as(usersDb, "org.couchdb.user:jchris", "jchris");
     TEquals(undefined, userDoc.password, "password field should be null 1");
     TEquals(scheme, userDoc.password_scheme, "password_scheme should be " + scheme);

-- 
To stop receiving notification emails like this one, please contact
jan@apache.org.