From 653733ba7f22ae677e7e03e5ac27128f57c9456a Mon Sep 17 00:00:00 2001 From: Pauli Virtanen Date: Sun, 30 Sep 2018 14:07:34 +0300 Subject: [PATCH] TST: move lock.acquire to correct place Can release only if acquire was successful. --- test/tools.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/test/tools.py b/test/tools.py index 2dea203a5..1a7b6231d 100644 --- a/test/tools.py +++ b/test/tools.py @@ -121,9 +121,8 @@ def locked_cache_dir(config, cache_key, timeout=900, tag=None): cache_dir = join(six.text_type(base_dir), 'cache') lock = LockFile(lockfile) + lock.acquire(timeout=timeout) try: - lock.acquire(timeout=timeout) - # Clear cache dir contents if it was generated with different # asv version tag_fn = join(six.text_type(base_dir), 'tag.json')