Fri, 26 Oct 2018 17:12:26 +0200 Make test database template creation concurrent
Philippe Pepiot <philippe.pepiot@logilab.fr> [Fri, 26 Oct 2018 17:12:26 +0200] rev 12357
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
Fri, 26 Oct 2018 17:00:05 +0200 Make test database cache lookup concurrent
Philippe Pepiot <philippe.pepiot@logilab.fr> [Fri, 26 Oct 2018 17:00:05 +0200] rev 12356
Make test database cache lookup concurrent has_cache() is used to dertermine if the template database already exists or not. When running tests accross multiple process, has_cache() wasn't aware of databases created by other processes because it used a cache to generate the cache... Since the discovering discover_cached_db() time is quite reasonable (it's just about listing file in a directory), let re-generate the cache on cache miss.
Mon, 29 Oct 2018 10:04:31 +0100 Fix flake8 issues since release 3.6.0
Philippe Pepiot <philippe.pepiot@logilab.fr> [Mon, 29 Oct 2018 10:04:31 +0100] rev 12355
Fix flake8 issues since release 3.6.0 Flake8 had a new release which raise new issues, namely: W504: line break after binary operator F841: local variable 'ex' is assigned to but never used W605: invalid escape sequence F821: undefined name 'buffer' (noqa seems the only way to avoid this false positive) Also pin flake8>=3.6 in our tests and make explicit that we use python3 to run flake8 tests.
(0) -10000 -3000 -1000 -300 -100 -30 -10 -3 +3 +10 +30 +100 +300 tip