__pkginfo__.py
author Philippe Pepiot <philippe.pepiot@logilab.fr>
Fri, 26 Oct 2018 17:12:26 +0200
changeset 12357 e385c9732f1e
parent 11382 dab704a0e4b1
permissions lrwxrwxrwx
Make test database template creation concurrent build_db_cache() is used in tests to create test database templates, i.e. DEFAULT_EMPTY_DB_ID (which is __default_empty_db__) and custom template database using CubicwebTC test_db_id/pre_setup_database API. When running tests in parallel using multiple processes, build_db_cache() may try to build the same database twice. Avoid this by adding synchronisation of process by using a file lock. So when two processes require the same template database, one build the database and others wait it to be created. Use filelock (https://github.com/benediktschmitt/py-filelock) library to have a portable (unix / windows) way for handling locks. Also filelock is packaged in debian: https://packages.debian.org/source/python-filelock

cubicweb/__pkginfo__.py