improve ddoc test reliablilty by waiting for ddoc deletion
authorJan Lehnardt <jan@apache.org>
Mon, 16 Jul 2018 10:01:54 +0000 (12:01 +0200)
committerJan Lehnardt <jan@apache.org>
Mon, 16 Jul 2018 10:49:18 +0000 (12:49 +0200)
test/javascript/tests/design_docs.js

index 6e12001..ed1e72f 100644 (file)
@@ -373,7 +373,13 @@ couchTests.design_docs = function(debug) {
     }
 
     T(db.deleteDoc(designDoc).ok);
-    T(db.open(designDoc._id) == null);
+    waitForSuccess(function() {
+      var ddoc = db.open(designDoc._id)
+      if (ddoc != null) {
+        throw({});
+      }
+      return true;
+    }, 'db.open(designDoc._id)');
     T(db.view("test/no_docs") == null);
 
     T(db.ensureFullCommit().ok);