Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id AC3E2200D3A for ; Wed, 1 Nov 2017 03:52:18 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id AAE31160BFB; Wed, 1 Nov 2017 02:52:18 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 08601160BFC for ; Wed, 1 Nov 2017 03:52:17 +0100 (CET) Received: (qmail 63052 invoked by uid 500); 1 Nov 2017 02:52:17 -0000 Mailing-List: contact commits-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@couchdb.apache.org Delivered-To: mailing list commits@couchdb.apache.org Received: (qmail 63028 invoked by uid 99); 1 Nov 2017 02:52:17 -0000 Received: from ec2-52-202-80-70.compute-1.amazonaws.com (HELO gitbox.apache.org) (52.202.80.70) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 01 Nov 2017 02:52:17 +0000 Received: by gitbox.apache.org (ASF Mail Server at gitbox.apache.org, from userid 33) id BCF7E81C2E; Wed, 1 Nov 2017 02:52:14 +0000 (UTC) Date: Wed, 01 Nov 2017 02:52:22 +0000 To: "commits@couchdb.apache.org" Subject: [couchdb] 09/19: use delay instead MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit From: wohali@apache.org In-Reply-To: <150950473377.30664.8382891356981763549@gitbox.apache.org> References: <150950473377.30664.8382891356981763549@gitbox.apache.org> X-Git-Host: gitbox.apache.org X-Git-Repo: couchdb X-Git-Refname: refs/heads/2.1.x X-Git-Reftype: branch X-Git-Rev: 5ef1810882689837c2887b9068e9f1053f3a8340 X-Git-NotificationType: diff X-Git-Multimail-Version: 1.5.dev Auto-Submitted: auto-generated Message-Id: <20171101025214.BCF7E81C2E@gitbox.apache.org> archived-at: Wed, 01 Nov 2017 02:52:18 -0000 This is an automated email from the ASF dual-hosted git repository. wohali pushed a commit to branch 2.1.x in repository https://gitbox.apache.org/repos/asf/couchdb.git commit 5ef1810882689837c2887b9068e9f1053f3a8340 Author: Tony Sun 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" .