Revert "Make loginUser wait for successful authentication"
authorJoan Touzet <joant@atypical.net>
Wed, 18 Jul 2018 16:23:36 +0000 (12:23 -0400)
committerJoan Touzet <wohali@users.noreply.github.com>
Wed, 18 Jul 2018 18:31:35 +0000 (14:31 -0400)
This reverts commit 6ffe0421ac524138a6b48fd010f2540631b83d16.

test/javascript/tests/users_db_security.js

index c55c764..4cc154e 100644 (file)
@@ -32,13 +32,7 @@ couchTests.users_db_security = function(debug) {
     // the actual tests
     var username1 = username.replace(/[0-9]$/, "");
     var password = pws[username];
-    waitForSuccess(function() {
-      var req = CouchDB.login(username1, pws[username]);
-      if (req.ok) {
-        return true
-      }
-      throw({});
-    }, 'loginUser');
+    T(CouchDB.login(username1, pws[username]).ok);
   };
 
   var open_as = function(db, docId, username) {
@@ -113,6 +107,7 @@ 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);