From 316005651688a7c775e9ab62092c6ba9720ba1c0 Mon Sep 17 00:00:00 2001 From: Pavol Juhas Date: Fri, 10 May 2024 15:33:03 -0700 Subject: [PATCH] CI - deflake `Isolated pytest Ubuntu` (#6593) Problem: `test_isolated_packages` may run clashing parallel builds of a local `cirq_core` wheel. Solution: Run pip-install with the `--no-clean` option so parallel builds do not delete active files. Also invoke isolated_packages_test.py with `--enable-slow-tests` in CI to include non-slow tests if ever added to that file. --- .github/workflows/ci.yml | 2 +- dev_tools/packaging/isolated_packages_test.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e780b733e6b..f4ee30b9963 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -144,7 +144,7 @@ jobs: - name: Install dependencies run: pip install -r dev_tools/requirements/isolated-base.env.txt - name: Test each module in isolation - run: pytest -n auto -m slow dev_tools/packaging/isolated_packages_test.py + run: pytest -n auto --enable-slow-tests dev_tools/packaging/isolated_packages_test.py pytest: name: Pytest Ubuntu strategy: diff --git a/dev_tools/packaging/isolated_packages_test.py b/dev_tools/packaging/isolated_packages_test.py index 50b186f6b41..8c2d2865c4a 100644 --- a/dev_tools/packaging/isolated_packages_test.py +++ b/dev_tools/packaging/isolated_packages_test.py @@ -39,7 +39,7 @@ def test_isolated_packages(cloned_env, module): assert f'cirq-core=={module.version}' in module.install_requires result = shell_tools.run( - f"{env}/bin/pip install ./{module.root} ./cirq-core".split(), + f"{env}/bin/pip install --no-clean ./{module.root} ./cirq-core".split(), stderr=subprocess.PIPE, check=False, )