Skip to content

Commit dacf283

Browse files
committed
misc: Add timeout
1 parent fb8e39d commit dacf283

2 files changed

Lines changed: 11 additions & 3 deletions

File tree

conftest.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -187,10 +187,17 @@ def parallel(item, m):
187187
testname = get_testname(item)
188188
# Only spew tracebacks on rank 0.
189189
# Run xfailing tests to ensure that errors are reported to calling process
190-
args = ["-n", "1", pyversion, "-m", "pytest", "-s", "--runxfail", "-v", testname]
190+
args = [
191+
"-n", "1", pyversion, "-m", "pytest", "-s", "--runxfail", "-v",
192+
"--timeout=600", "--timeout-method=thread", "-o faulthandler_timeout=660",
193+
testname
194+
]
191195
if nprocs > 1:
192-
args.extend([":", "-n", "%d" % (nprocs - 1), pyversion, "-m", "pytest",
193-
"-s", "--runxfail", "-v", "--no-summary", testname])
196+
args.extend([
197+
":", "-n", "%d" % (nprocs - 1), pyversion, "-m", "pytest",
198+
"-s", "--runxfail", "-v", "--timeout=600", "--timeout-method=thread",
199+
"-o faulthandler_timeout=660", testname
200+
])
194201
# OpenMPI requires an explicit flag for oversubscription. We need it as some
195202
# of the MPI tests will spawn lots of processes
196203
if mpi_distro == 'OpenMPI':

requirements-testing.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@ click<9.0
99
cloudpickle<3.1.3
1010
ipympl<0.9.9
1111
ipykernel<7.0.0
12+
pytest-timeout

0 commit comments

Comments
 (0)