From 31898d1ff046bd2bde69f1fd3620f5e234105c2e Mon Sep 17 00:00:00 2001 From: Mike Pennisi Date: Thu, 28 Feb 2019 21:55:04 -0500 Subject: [PATCH] [wpt] Avoid race condition during module install See https://github.com/web-platform-tests/results-collection/issues/649 --- tools/wpt/virtualenv.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tools/wpt/virtualenv.py b/tools/wpt/virtualenv.py index b27529da7a7e0c..61de936b7679e0 100644 --- a/tools/wpt/virtualenv.py +++ b/tools/wpt/virtualenv.py @@ -49,7 +49,13 @@ def start(self): self.activate() def install(self, *requirements): - call(self.pip_path, "install", *requirements) + # `--prefer-binary` guards against race conditions when installation + # occurs while packages are in the process of being published. + call(self.pip_path, "install", "--prefer-binary", *requirements) def install_requirements(self, requirements_path): - call(self.pip_path, "install", "-r", requirements_path) + # `--prefer-binary` guards against race conditions when installation + # occurs while packages are in the process of being published. + call( + self.pip_path, "install", "--prefer-binary", "-r", requirements_path + )