Skip to content

Commit

Permalink
Increase timeout for Mac CI (qiskit-community#1309)
Browse files Browse the repository at this point in the history
### 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.
  • Loading branch information
coruscating authored and nkanazawa1989 committed Jan 17, 2024
1 parent b10cd04 commit 0ca993a
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 4 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/cron-staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
9 changes: 8 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion test/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
1 change: 1 addition & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ passenv =
QISKIT_PARALLEL
RAYON_NUM_THREADS
QISKIT_IBM_*
TEST_TIMEOUT
commands = stestr run {posargs}

[testenv:cover]
Expand Down

0 comments on commit 0ca993a

Please sign in to comment.