You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by to...@apache.org on 2017/10/27 17:42:19 UTC

[couchdb] branch mango-test-failures updated: use delay instead

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

tonysun83 pushed a commit to branch mango-test-failures
in repository https://gitbox.apache.org/repos/asf/couchdb.git


The following commit(s) were added to refs/heads/mango-test-failures by this push:
     new 4540b4a  use delay instead
4540b4a is described below

commit 4540b4ab80ee7da98e7044231ec0ef97c0b513b6
Author: Tony Sun <to...@gmail.com>
AuthorDate: Fri Oct 27 10:43:58 2017 -0700

    use delay instead
---
 src/mango/test/mango.py | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/src/mango/test/mango.py b/src/mango/test/mango.py
index 1ed2a2c..dd58e74 100644
--- a/src/mango/test/mango.py
+++ b/src/mango/test/mango.py
@@ -33,6 +33,11 @@ def get_from_environment(key, default):
     value = os.environ.get(key)
     return value if value is not None else default
 
+# add delay functionality
+def delay(n=5, t=0.2):
+    for i in range(0, n):
+        time.sleep(t)
+
 
 class Database(object):
     def __init__(self, dbname,
@@ -77,9 +82,9 @@ class Database(object):
 
     def recreate(self):
         self.delete()
-        time.sleep(1)
+        delay()
         self.create()
-        time.sleep(1)
+        delay()
 
     def save_doc(self, doc):
         self.save_docs([doc])
@@ -166,13 +171,14 @@ class Database(object):
 
     def delete_index(self, ddocid, name, idx_type="json"):
         path = ["_index", ddocid, idx_type, name]
-        r = self.sess.delete(self.path(path), params={"w": "1"})
+        r = self.sess.delete(self.path(path), params={"w": "3"})
+        delay()
         r.raise_for_status()
 
     def bulk_delete(self, docs):
         body = {
             "docids" : docs,
-            "w": 1
+            "w": 3
         }
         body = json.dumps(body)
         r = self.sess.post(self.path("_index/_bulk_delete"), data=body)

-- 
To stop receiving notification emails like this one, please contact
['"commits@couchdb.apache.org" <co...@couchdb.apache.org>'].