Commit cd5c7e97 authored by Julien Muchembled's avatar Julien Muchembled

Fix testLateInvalidationFromZEO for Zope 2.12

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@43448 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 97974a87
...@@ -106,17 +106,17 @@ class TestInvalidationBug(ERP5TypeTestCase): ...@@ -106,17 +106,17 @@ class TestInvalidationBug(ERP5TypeTestCase):
### Prepare unit test, to minimize amount of work during critical section ### Prepare unit test, to minimize amount of work during critical section
## url to create some content using another zope ## url to create some content using another zope
new_content_url = "http://ERP5TypeTestCase:@%s%s/newContent" % ( new_content_url = "http://ERP5TypeTestCase:@%s%s/Folder_create" % (
node_list[0], self.portal.organisation_module.getPath()) node_list[0], self.portal.organisation_module.getPath())
## prepare freeze/unfreeze of ZEO storage ## prepare freeze/unfreeze of ZEO storage
from asyncore import socket_map
zeo_connection = storage._connection zeo_connection = storage._connection
socket_map = zeo_connection._map
freeze_lock = threading.Lock() freeze_lock = threading.Lock()
freeze_lock.acquire() freeze_lock.acquire()
def unfreezeStorage(): def unfreezeStorage():
socket_map[zeo_connection.fileno()] = zeo_connection socket_map[zeo_connection.fileno()] = zeo_connection
# wake up asyncore loop to take the new socket into account # wake up asyncore loop to take the new socket into account
zeo_connection._pull_trigger() zeo_connection.trigger.pull_trigger()
# link to ZEO will be unfrozen 1 second after we read 'message' table # link to ZEO will be unfrozen 1 second after we read 'message' table
unfreeze_timer = threading.Timer(1, unfreezeStorage) unfreeze_timer = threading.Timer(1, unfreezeStorage)
unfreeze_timer.setDaemon(True) unfreeze_timer.setDaemon(True)
......
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