You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by ei...@apache.org on 2018/01/04 17:45:13 UTC

[couchdb] branch better-mango-test-recreate-function updated (1456f3e -> 0414ef3)

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

eiri pushed a change to branch better-mango-test-recreate-function
in repository https://gitbox.apache.org/repos/asf/couchdb.git.


    omit 1456f3e  Merge branch 'master' into better-mango-test-recreate-function
    omit 0dfbad5  Make sure mango tests's recreate fun creates db
     add f3ecd13  Use uuid in tmp db names in unit tests
     add bc192d1  Merge pull request #1092 from apache/use-uuid-in-eunit-dbnames
     new 0414ef3  Make sure mango tests's recreate fun creates db

This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version.  This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:

 * -- * -- B -- O -- O -- O   (1456f3e)
            \
             N -- N -- N   refs/heads/better-mango-test-recreate-function (0414ef3)

You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.

Any revisions marked "omit" are not gone; other references still
refer to them.  Any revisions marked "discard" are gone forever.

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 src/couch/include/couch_eunit.hrl | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)

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

[couchdb] 01/01: Make sure mango tests's recreate fun creates db

Posted by ei...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

eiri pushed a commit to branch better-mango-test-recreate-function
in repository https://gitbox.apache.org/repos/asf/couchdb.git

commit 0414ef3e5d39de159cb6e985110773ea5522aea4
Author: Eric Avdey <ei...@eiri.ca>
AuthorDate: Thu Jan 4 12:05:36 2018 -0400

    Make sure mango tests's recreate fun creates db
    
    Rapid same database deletion/creation is a known
    antipattern prone to a race condition, especially
    on slow VMs.
    
    This fix modifies mango test's helper function
    used for db recreation to ensure that we are actually
    starting tests when a database created and empty.
---
 src/mango/test/mango.py | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/src/mango/test/mango.py b/src/mango/test/mango.py
index 560914b..ecf969e 100644
--- a/src/mango/test/mango.py
+++ b/src/mango/test/mango.py
@@ -82,13 +82,15 @@ class Database(object):
 
     def recreate(self):
         r = self.sess.get(self.url)
-        db_info = r.json()
-        docs = db_info["doc_count"] + db_info["doc_del_count"]
-        if docs == 0:
-            # db never used - create unnecessary
-            return
-        self.delete()
+        if r.status_code == 200:
+            db_info = r.json()
+            docs = db_info["doc_count"] + db_info["doc_del_count"]
+            if docs == 0:
+                # db never used - create unnecessary
+                return
+            self.delete()
         self.create()
+        self.recreate()
 
     def save_doc(self, doc):
         self.save_docs([doc])

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