Skip to content

Commit 7a9ee61

Browse files
authored
Maintenance: small CI and test-helper cleanups (#2126)
* ci: add 60 minute timeouts to test jobs Add explicit 60 minute GitHub Actions timeouts to the reusable test workflows so hung test runs release runners promptly. This intentionally covers only test jobs because build jobs are expected to be extremely unlikely to hang, while the recent CI failures came from tests wedging for hours. * fix trivial spelling errors in two files Fix trivial spelling errors, including errors pointed out in PR #2103. * Align WSL detection helpers Remove the environment-variable fallback from cuda_python_test_helpers._detect_wsl so the test helper matches cuda.core's /proc-based WSL detection. Add comments to both copies to keep the duplicated implementations synchronized. Xref: https://github.com/NVIDIA/cuda-python/pull/2118/changes#r3278720224
1 parent c007c85 commit 7a9ee61

8 files changed

Lines changed: 14 additions & 8 deletions

File tree

.github/workflows/test-sdist-linux.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ permissions:
2222
jobs:
2323
test-sdist:
2424
name: Test sdist builds
25+
timeout-minutes: 60
2526
runs-on: linux-amd64-cpu8
2627
steps:
2728
- name: Checkout ${{ github.event.repository.name }}

.github/workflows/test-sdist-windows.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ permissions:
2828
jobs:
2929
test-sdist:
3030
name: Test sdist builds
31+
timeout-minutes: 60
3132
runs-on: windows-2022
3233
steps:
3334
- name: Checkout ${{ github.event.repository.name }}

.github/workflows/test-wheel-linux.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ jobs:
9696
9797
test:
9898
name: Python ${{ matrix.PY_VER }}, CUDA ${{ matrix.CUDA_VER }} (${{ (matrix.LOCAL_CTK == '1' && 'local') || 'wheels' }}), GPU ${{ matrix.GPU }}${{ matrix.GPU_COUNT != '1' && format(' (x{0})', matrix.GPU_COUNT) || '' }}${{ matrix.FLAVOR && format(', {0}', matrix.FLAVOR) || '' }}${{ matrix.TORCH_VER && format(', {0}', matrix.TORCH_VER) || '' }}${{ matrix.MODE == 'nightly-numba-cuda' && ', latest' || '' }}
99+
timeout-minutes: 60
99100
needs: compute-matrix
100101
strategy:
101102
fail-fast: false

.github/workflows/test-wheel-windows.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ jobs:
8888
8989
test:
9090
name: Python ${{ matrix.PY_VER }}, CUDA ${{ matrix.CUDA_VER }} (${{ (matrix.LOCAL_CTK == '1' && 'local') || 'wheels' }}), GPU ${{ matrix.GPU }}${{ matrix.GPU_COUNT != '1' && format(' (x{0})', matrix.GPU_COUNT) || '' }} (${{ matrix.DRIVER_MODE }})${{ matrix.TORCH_VER && format(', {0}', matrix.TORCH_VER) || '' }}${{ matrix.MODE == 'nightly-numba-cuda' && ', latest' || '' }}
91+
timeout-minutes: 60
9192
# The build stage could fail but we want the CI to keep moving.
9293
needs: compute-matrix
9394
strategy:

cuda_bindings/examples/2_Concepts_and_Techniques/stream_ordered_allocation.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ def stream_ordered_allocation_post_sync(dev, nelem, a, b, c):
137137
threshold_val,
138138
)
139139
)
140-
# Record teh start event
140+
# Record the start event
141141
check_cuda_errors(cudart.cudaEventRecord(start, stream))
142142
for _i in range(MAX_ITER):
143143
d_a = check_cuda_errors(cudart.cudaMallocAsync(num_bytes, stream))

cuda_core/cuda/core/system/_system.pyx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
CUDA_BINDINGS_NVML_IS_COMPATIBLE: bool
1212

1313

14+
# Please keep in sync with the equivalent implementation in
15+
# cuda_python_test_helpers/cuda_python_test_helpers/__init__.py.
1416
cdef bint _detect_wsl():
1517
try:
1618
with open("/proc/sys/kernel/osrelease") as f:

cuda_core/tests/memory_ipc/test_leaks.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ def test_alloc_handle(ipc_memory_resource):
3434

3535

3636
def exec_success(obj, number=1):
37-
"""Succesfully run a child process."""
37+
"""Successfully run a child process."""
3838
for _ in range(number):
3939
process = mp.Process(target=child_main, args=(obj,))
4040
process.start()
@@ -50,8 +50,8 @@ def child_main(obj, *args):
5050

5151
def exec_launch_failure(obj, number=1):
5252
"""
53-
Unsuccesfully try to launch a child process. This fails when
54-
after the child starts.
53+
Unsuccessfully try to launch a child process. This fails after
54+
the child starts.
5555
"""
5656
for _ in range(number):
5757
process = mp.Process(target=child_main_bad, args=(obj,))
@@ -68,7 +68,7 @@ def child_main_bad():
6868

6969
def exec_reduce_failure(obj, number=1):
7070
"""
71-
Unsuccesfully try to launch a child process. This fails before
71+
Unsuccessfully try to launch a child process. This fails before
7272
the child starts but after the resource-owning object is serialized.
7373
"""
7474
for _ in range(number):

cuda_python_test_helpers/cuda_python_test_helpers/__init__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@
1515
]
1616

1717

18+
# Please keep in sync with the equivalent implementation in
19+
# cuda_core/cuda/core/system/_system.pyx.
1820
def _detect_wsl() -> bool:
1921
data = ""
2022
with suppress(Exception), open("/proc/sys/kernel/osrelease") as f:
2123
data = f.read().lower()
22-
if "microsoft" in data or "wsl" in data:
23-
return True
24-
return any(os.environ.get(k) for k in ("WSL_DISTRO_NAME", "WSL_INTEROP"))
24+
return "microsoft" in data or "wsl" in data
2525

2626

2727
IS_WSL: bool = _detect_wsl()

0 commit comments

Comments
 (0)