From 12a71b91a803aadd171e2027c7f1761aafc72dae Mon Sep 17 00:00:00 2001 From: Helena Zhang Date: Wed, 1 Nov 2023 16:19:08 -0400 Subject: [PATCH] Increase timeout for Mac CI (#1309) ### Summary Mac CI tests can take significantly longer than Windows and Linux. This PR doubles the timeout for Mac tests so they don't fail as frequently and adds back the `OMP_NUM_THREADS: 1` option, which seems to help reduce individual test times. --- .github/workflows/cron-staging.yml | 5 +++-- .github/workflows/main.yml | 9 ++++++++- test/base.py | 2 +- tox.ini | 1 + 4 files changed, 13 insertions(+), 4 deletions(-) diff --git a/.github/workflows/cron-staging.yml b/.github/workflows/cron-staging.yml index 27bfad72cd..dec1ffc210 100644 --- a/.github/workflows/cron-staging.yml +++ b/.github/workflows/cron-staging.yml @@ -36,11 +36,12 @@ jobs: ${{ runner.os }}-${{ matrix.python-version }} - name: Install Deps run: python -m pip install -U tox setuptools virtualenv wheel - - name: Install and Run Tests + - name: Install and Run Tests (Windows and Linux) run: tox -e terra-main if: runner.os != 'macOS' - - name: Install and Run Tests + - name: Install and Run Tests (Macs only) run: tox -e terra-main if: runner.os == 'macOS' env: + TEST_TIMEOUT: 120 OMP_NUM_THREADS: 1 \ No newline at end of file diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 4f45bb6170..a0f990eaab 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -49,8 +49,15 @@ jobs: stestr- - name: Install Deps run: python -m pip install -U tox setuptools virtualenv wheel stestr - - name: Install and Run Tests + - name: Install and Run Tests (Windows and Linux) run: tox -e py + if: runner.os != 'macOS' + - name: Install and Run Tests (Macs only) + run: tox -e py + if: runner.os == 'macOS' + env: + TEST_TIMEOUT: 120 + OMP_NUM_THREADS: 1 - name: Clean up stestr cache run: stestr history remove all diff --git a/test/base.py b/test/base.py index d1ad6e8ed6..dc7384afb9 100644 --- a/test/base.py +++ b/test/base.py @@ -33,7 +33,7 @@ from .extended_equality import is_equivalent # Fail tests that take longer than this -TEST_TIMEOUT = os.environ.get("TEST_TIMEOUT", 60) +TEST_TIMEOUT = int(os.environ.get("TEST_TIMEOUT", 60)) class QiskitExperimentsTestCase(QiskitTestCase): diff --git a/tox.ini b/tox.ini index 70be5b521e..658e81e57a 100644 --- a/tox.ini +++ b/tox.ini @@ -17,6 +17,7 @@ passenv = QISKIT_PARALLEL RAYON_NUM_THREADS QISKIT_IBM_* + TEST_TIMEOUT commands = stestr run {posargs} [testenv:cover]