summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--common/changes/bug_4475_remodel-couch-backend2
-rw-r--r--common/src/leap/soledad/common/tests/test_couch.py16
2 files changed, 17 insertions, 1 deletions
diff --git a/common/changes/bug_4475_remodel-couch-backend b/common/changes/bug_4475_remodel-couch-backend
new file mode 100644
index 00000000..13a1b121
--- /dev/null
+++ b/common/changes/bug_4475_remodel-couch-backend
@@ -0,0 +1,2 @@
+ o Remodel couch backend to fix concurrency and scalability. Closes #4475,
+ #4682, #4683 and #4680.
diff --git a/common/src/leap/soledad/common/tests/test_couch.py b/common/src/leap/soledad/common/tests/test_couch.py
index 48b3585f..72346333 100644
--- a/common/src/leap/soledad/common/tests/test_couch.py
+++ b/common/src/leap/soledad/common/tests/test_couch.py
@@ -223,8 +223,22 @@ class CouchTests(test_backends.AllDatabaseTests, CouchDBTestCase):
scenarios = COUCH_SCENARIOS
+ def setUp(self):
+ test_backends.AllDatabaseTests.setUp(self)
+ # save db info because of test_close
+ self._server = self.db._server
+ self._dbname = self.db._dbname
+
def tearDown(self):
- self.db.delete_database()
+ # if current test is `test_close` we have to use saved objects to
+ # delete the database because the close() method will have removed the
+ # references needed to do it using the CouchDatabase.
+ if self.id() == \
+ 'leap.soledad.common.tests.test_couch.CouchTests.' \
+ 'test_close(couch)':
+ del(self._server[self._dbname])
+ else:
+ self.db.delete_database()
test_backends.AllDatabaseTests.tearDown(self)