Commit 271cc7d9 authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

testERP5Catalog: add READ-COMMITTED connection in hot reindex test.

parent 2d0c4df2
...@@ -30,6 +30,7 @@ ...@@ -30,6 +30,7 @@
from functools import partial from functools import partial
import httplib import httplib
from random import randint from random import randint
import re
import sys import sys
import threading import threading
import traceback import traceback
...@@ -211,6 +212,7 @@ class TestERP5Catalog(ERP5TypeTestCase, LogInterceptor): ...@@ -211,6 +212,7 @@ class TestERP5Catalog(ERP5TypeTestCase, LogInterceptor):
# Different variables used for this test # Different variables used for this test
username = 'seb' username = 'seb'
new_erp5_sql_connection = 'erp5_sql_connection2' new_erp5_sql_connection = 'erp5_sql_connection2'
new_erp5_sql_read_committed_connection = 'erp5_sql_read_committed_connection2'
new_erp5_deferred_sql_connection = 'erp5_sql_deferred_connection2' new_erp5_deferred_sql_connection = 'erp5_sql_deferred_connection2'
new_catalog_id = 'erp5_mysql_innodb2' new_catalog_id = 'erp5_mysql_innodb2'
...@@ -242,6 +244,8 @@ class TestERP5Catalog(ERP5TypeTestCase, LogInterceptor): ...@@ -242,6 +244,8 @@ class TestERP5Catalog(ERP5TypeTestCase, LogInterceptor):
# Remove copied sql_connector and catalog # Remove copied sql_connector and catalog
if self.new_erp5_sql_connection in self.portal.objectIds(): if self.new_erp5_sql_connection in self.portal.objectIds():
self.portal.manage_delObjects([self.new_erp5_sql_connection]) self.portal.manage_delObjects([self.new_erp5_sql_connection])
if self.new_erp5_sql_read_committed_connection in self.portal.objectIds():
self.portal.manage_delObjects([self.new_erp5_sql_read_committed_connection])
if self.new_erp5_deferred_sql_connection in self.portal.objectIds(): if self.new_erp5_deferred_sql_connection in self.portal.objectIds():
self.portal.manage_delObjects([self.new_erp5_deferred_sql_connection]) self.portal.manage_delObjects([self.new_erp5_deferred_sql_connection])
if self.new_catalog_id in self.portal.portal_catalog.objectIds(): if self.new_catalog_id in self.portal.portal_catalog.objectIds():
...@@ -1317,6 +1321,7 @@ class TestERP5Catalog(ERP5TypeTestCase, LogInterceptor): ...@@ -1317,6 +1321,7 @@ class TestERP5Catalog(ERP5TypeTestCase, LogInterceptor):
""" """
portal = self.portal portal = self.portal
original_connection_id = 'erp5_sql_connection' original_connection_id = 'erp5_sql_connection'
original_read_committed_connection_id = 'erp5_sql_read_committed_connection'
original_deferred_connection_id = 'erp5_sql_deferred_connection' original_deferred_connection_id = 'erp5_sql_deferred_connection'
new_connection_string = getExtraSqlConnectionStringList()[0] new_connection_string = getExtraSqlConnectionStringList()[0]
...@@ -1334,6 +1339,11 @@ class TestERP5Catalog(ERP5TypeTestCase, LogInterceptor): ...@@ -1334,6 +1339,11 @@ class TestERP5Catalog(ERP5TypeTestCase, LogInterceptor):
addSQLConnection(self.new_erp5_sql_connection,'', new_connection_string) addSQLConnection(self.new_erp5_sql_connection,'', new_connection_string)
new_connection = portal[self.new_erp5_sql_connection] new_connection = portal[self.new_erp5_sql_connection]
new_connection.manage_open_connection() new_connection.manage_open_connection()
addSQLConnection(self.new_erp5_sql_read_committed_connection, '',
re.sub(
r'((?:[%*][^ ]+ )*)(![^ ]+ )?(.+)', r'\1!READ-COMMITTED \3', new_connection_string))
new_connection = portal[self.new_erp5_sql_read_committed_connection]
new_connection.manage_open_connection()
addSQLConnection(self.new_erp5_deferred_sql_connection,'', addSQLConnection(self.new_erp5_deferred_sql_connection,'',
new_connection_string) new_connection_string)
new_connection = portal[self.new_erp5_deferred_sql_connection] new_connection = portal[self.new_erp5_deferred_sql_connection]
...@@ -1404,8 +1414,10 @@ class TestERP5Catalog(ERP5TypeTestCase, LogInterceptor): ...@@ -1404,8 +1414,10 @@ class TestERP5Catalog(ERP5TypeTestCase, LogInterceptor):
# prepare arguments for hot reindex # prepare arguments for hot reindex
source_sql_connection_id_list=list((original_connection_id, source_sql_connection_id_list=list((original_connection_id,
original_read_committed_connection_id,
original_deferred_connection_id)) original_deferred_connection_id))
destination_sql_connection_id_list=list((self.new_erp5_sql_connection, destination_sql_connection_id_list=list((self.new_erp5_sql_connection,
self.new_erp5_sql_read_committed_connection,
self.new_erp5_deferred_sql_connection)) self.new_erp5_deferred_sql_connection))
# launch the full hot reindexing # launch the full hot reindexing
portal_catalog.manage_hotReindexAll(source_sql_catalog_id=original_catalog_id, portal_catalog.manage_hotReindexAll(source_sql_catalog_id=original_catalog_id,
......
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