You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@couchdb.apache.org by GitBox <gi...@apache.org> on 2018/03/28 14:11:06 UTC

[GitHub] janl closed pull request #1250: fix: more reliable password scheme tests

janl closed pull request #1250: fix: more reliable password scheme tests
URL: https://github.com/apache/couchdb/pull/1250
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/test/javascript/couch_test_runner.js b/test/javascript/couch_test_runner.js
index 47f1ad95cd..7fe8ed39f2 100644
--- a/test/javascript/couch_test_runner.js
+++ b/test/javascript/couch_test_runner.js
@@ -427,7 +427,9 @@ function waitForSuccess(fun, tag) {
       try {
         fun();
         break;
-      } catch (e) {}
+      } catch (e) {
+        log(e)
+      }
       // sync http req allow async req to happen
       try {
         CouchDB.request("GET", "/test_suite_db/?tag="+encodeURIComponent(tag));
diff --git a/test/javascript/tests/users_db_security.js b/test/javascript/tests/users_db_security.js
index 536585acf2..4cc154edd8 100644
--- a/test/javascript/tests/users_db_security.js
+++ b/test/javascript/tests/users_db_security.js
@@ -411,11 +411,27 @@ couchTests.users_db_security = function(debug) {
       function() {
         try {
           testFun(scheme, derivedKeyTests[scheme], saltTests[scheme]);
+        } catch (e) {
+          throw(e)
         } finally {
           CouchDB.login("jan", "apple");
           usersDb.deleteDb(); // cleanup
-          sleep(5000);
+          waitForSuccess(function() {
+            var req = CouchDB.request("GET", db_name);
+            if (req.status == 404) {
+              return true
+            }
+            throw({});
+          }, 'usersDb.deleteDb')
+
           usersDb.createDb();
+          waitForSuccess(function() {
+            var req = CouchDB.request("GET", db_name);
+            if (req.status == 200) {
+              return true
+            }
+            throw({});
+          }, 'usersDb.creteDb')
         }
       }
     );
@@ -501,8 +517,21 @@ couchTests.users_db_security = function(debug) {
       } finally {
         CouchDB.login("jan", "apple");
         usersDb.deleteDb(); // cleanup
-        sleep(5000);
+        waitForSuccess(function() {
+          var req = CouchDB.request("GET", db_name);
+          if (req.status == 404) {
+            return true
+          }
+          throw({});
+        }, 'usersDb.deleteDb')
         usersDb.createDb();
+        waitForSuccess(function() {
+          var req = CouchDB.request("GET", db_name);
+          if (req.status == 200) {
+            return true
+          }
+          throw({});
+        }, 'usersDb.creteDb')
       }
     }
   );


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services