[test] properly close connections during test stable
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Tue, 15 Jun 2010 18:00:30 +0200
branchstable
changeset 5751 1e5ef464cade
parent 5750 b3bc214cd479
child 5752 b0bb553e3be4
child 5755 ca9e1c9123d7
[test] properly close connections during test
devtools/testlib.py
server/sources/native.py
--- a/devtools/testlib.py	Tue Jun 15 18:00:29 2010 +0200
+++ b/devtools/testlib.py	Tue Jun 15 18:00:30 2010 +0200
@@ -83,6 +83,9 @@
 
 
 def refresh_repo(repo, resetschema=False, resetvreg=False):
+    for pool in repo.pools:
+        pool.close(True)
+    repo.system_source.shutdown()
     devtools.reset_test_database(repo.config)
     for pool in repo.pools:
         pool.reconnect()
--- a/server/sources/native.py	Tue Jun 15 18:00:29 2010 +0200
+++ b/server/sources/native.py	Tue Jun 15 18:00:30 2010 +0200
@@ -338,6 +338,7 @@
     def shutdown(self):
         if self._eid_creation_cnx:
             self._eid_creation_cnx.close()
+            self._eid_creation_cnx = None
 
     # XXX deprecates [un]map_attribute ?
     def map_attribute(self, etype, attr, cb, sourcedb=True):