*: replace erp5_site_global_id by a mechanism in test framework
erp5_site_global_id was from the tiolive time, when we were using ERP5 with mariadb and memcached instances shared by many zope instances, this was used as a way to implement namespaces in memcached, to prevent conflicts such as two different zope using the same cache keys. Nowadays, we no longer share memcached, each ERP5 instance has its own memcached and this prefixing is no longer needed, but there is still one exception, when we run test using runTestSuite with --node_quantity higher than 1, we have multiple running test instances sharing the same mariadb and the same memcached. In that case, each test instance uses a different mariadb database, but the risk of conflict remain for memcached. To solve this, we introduce a prefix for keys, choosen randomly at test startup. This was more or less what the current implementation was trying to do, but we were setting erp5_site_global_id on the wrong object, so it was not working since 4889d523 (Define property's default value at class level., 2012-12-31). Also, this was only done at the level of SharedDict, but some APIs such as CacheTool or SessionTool use MemcachedDict directly. There was other problems that using the sql connection string encoded in base64 was a too long prefix, because memcached are limited in size. Also it was not preventing collisions when running tests on the same test node, each runUnitTest execution was still having pollution from the previous runUnitTest.
Showing
Please register or sign in to comment