Skip to content

Commit 12a71b9

Browse files
authored
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.
1 parent 39a0d87 commit 12a71b9

File tree

4 files changed

+13
-4
lines changed

4 files changed

+13
-4
lines changed

.github/workflows/cron-staging.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,12 @@ jobs:
3636
${{ runner.os }}-${{ matrix.python-version }}
3737
- name: Install Deps
3838
run: python -m pip install -U tox setuptools virtualenv wheel
39-
- name: Install and Run Tests
39+
- name: Install and Run Tests (Windows and Linux)
4040
run: tox -e terra-main
4141
if: runner.os != 'macOS'
42-
- name: Install and Run Tests
42+
- name: Install and Run Tests (Macs only)
4343
run: tox -e terra-main
4444
if: runner.os == 'macOS'
4545
env:
46+
TEST_TIMEOUT: 120
4647
OMP_NUM_THREADS: 1

.github/workflows/main.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,15 @@ jobs:
4949
stestr-
5050
- name: Install Deps
5151
run: python -m pip install -U tox setuptools virtualenv wheel stestr
52-
- name: Install and Run Tests
52+
- name: Install and Run Tests (Windows and Linux)
5353
run: tox -e py
54+
if: runner.os != 'macOS'
55+
- name: Install and Run Tests (Macs only)
56+
run: tox -e py
57+
if: runner.os == 'macOS'
58+
env:
59+
TEST_TIMEOUT: 120
60+
OMP_NUM_THREADS: 1
5461
- name: Clean up stestr cache
5562
run: stestr history remove all
5663

test/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
from .extended_equality import is_equivalent
3434

3535
# Fail tests that take longer than this
36-
TEST_TIMEOUT = os.environ.get("TEST_TIMEOUT", 60)
36+
TEST_TIMEOUT = int(os.environ.get("TEST_TIMEOUT", 60))
3737

3838

3939
class QiskitExperimentsTestCase(QiskitTestCase):

tox.ini

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ passenv =
1717
QISKIT_PARALLEL
1818
RAYON_NUM_THREADS
1919
QISKIT_IBM_*
20+
TEST_TIMEOUT
2021
commands = stestr run {posargs}
2122

2223
[testenv:cover]

0 commit comments

Comments
 (0)