Skip to content

Commit 1bc8764

Browse files
authored
TST: skip test if spawning threads triggers a RuntimeError (numpy#28798)
1 parent 9ead596 commit 1bc8764

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

numpy/testing/_private/utils.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2741,6 +2741,11 @@ def run_threaded(func, max_workers=8, pass_count=False,
27412741
futures = []
27422742
for arg in all_args:
27432743
futures.append(tpe.submit(*arg))
2744+
except RuntimeError as e:
2745+
import pytest
2746+
pytest.skip(f"Spawning {max_workers} threads failed with "
2747+
f"error {e!r} (likely due to resource limits on the "
2748+
"system running the tests)")
27442749
finally:
27452750
if len(futures) < max_workers and pass_barrier:
27462751
barrier.abort()

0 commit comments

Comments
 (0)