Commit 0f9c9e5c authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

testERP5Catalog: commit transaction before deletion to avoid deadlocks.

also commit transaction between index and search.
parent b89148e0
...@@ -231,6 +231,7 @@ class TestERP5Catalog(ERP5TypeTestCase, LogInterceptor): ...@@ -231,6 +231,7 @@ class TestERP5Catalog(ERP5TypeTestCase, LogInterceptor):
self.tic() self.tic()
def beforeTearDown(self): def beforeTearDown(self):
self.commit()
# restore default_catalog # restore default_catalog
self.portal.portal_catalog._setDefaultSqlCatalogId('erp5_mysql_innodb') self.portal.portal_catalog._setDefaultSqlCatalogId('erp5_mysql_innodb')
self.portal.portal_catalog.hot_reindexing_state = None self.portal.portal_catalog.hot_reindexing_state = None
...@@ -3696,6 +3697,7 @@ VALUES ...@@ -3696,6 +3697,7 @@ VALUES
def test_IndexationContextIndependence(self): def test_IndexationContextIndependence(self):
def doCatalog(catalog, document): def doCatalog(catalog, document):
catalog.catalogObjectList([document], check_uid=0) catalog.catalogObjectList([document], check_uid=0)
self.commit()
result = catalog(select_list=['reference'], uid=document.getUid()) result = catalog(select_list=['reference'], uid=document.getUid())
self.assertEqual(len(result), 1) self.assertEqual(len(result), 1)
return result[0].reference return result[0].reference
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment