Skip to content

Commit 4357f37

Browse files
authored
test(cuda.core): serialize thread-unsafe IPC error tests (#2785)
Signed-off-by: Rui Luo <[email protected]>
1 parent 4aa48f5 commit 4357f37

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

‎cuda_core/tests/memory_ipc/test_errors.py‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,12 @@ class ChildErrorHarness:
118118
"""Test harness for checking errors in child processes. Subclasses override
119119
PARENT_ACTION, CHILD_ACTION, and ASSERT (see below for examples)."""
120120

121+
@pytest.mark.thread_unsafe(
122+
reason=(
123+
"pytest-run-parallel reuses the same instance and ipc fixtures across "
124+
"workers; Process(target=self.child_main) pickles that shared state (#2784)"
125+
)
126+
)
121127
@pytest.mark.flaky(reruns=2)
122128
def test_main(self, ipc_device, ipc_memory_resource):
123129
"""Parent process that checks child errors."""
@@ -267,6 +273,9 @@ def ASSERT(self, exc_type, exc_msg):
267273

268274

269275
@pytest.mark.skipif(platform.system() != "Linux", reason="CUDA mempool IPC is Linux-only")
276+
@pytest.mark.thread_unsafe(
277+
reason="serialize the affected IPC mempool import/destroy path under pytest-run-parallel (#2784)"
278+
)
270279
@pytest.mark.agent_authored(model="gpt-5.6-sol")
271280
def test_from_allocation_handle_raw_fd_imports_mapped_pool(ipc_device):
272281
"""from_allocation_handle accepts a raw int fd and constructs an unregistered mapped MR."""
@@ -303,6 +312,9 @@ def test_from_allocation_handle_raw_fd_imports_mapped_pool(ipc_device):
303312

304313

305314
@pytest.mark.skipif(platform.system() != "Linux", reason="CUDA mempool IPC is Linux-only")
315+
@pytest.mark.thread_unsafe(
316+
reason="concurrent IPC mempool export/destroy SEGV in cuMemPoolDestroy under pytest-run-parallel (#2784)"
317+
)
306318
@pytest.mark.agent_authored(model="gpt-5.6-sol")
307319
def test_allocation_handle_forking_pickler_roundtrip(ipc_device):
308320
"""ForkingPickler transfers an IPCAllocationHandle by duplicating its fd."""
@@ -328,6 +340,9 @@ def test_allocation_handle_forking_pickler_roundtrip(ipc_device):
328340

329341

330342
@pytest.mark.skipif(platform.system() != "Linux", reason="CUDA mempool IPC is Linux-only")
343+
@pytest.mark.thread_unsafe(
344+
reason="concurrent IPC mempool import/destroy SEGV in cuMemPoolDestroy under pytest-run-parallel (#2784)"
345+
)
331346
@pytest.mark.agent_authored(model="gpt-5.6-sol")
332347
def test_ipc_registry_dedups_repeated_imports(ipc_device):
333348
"""from_allocation_handle registers the mapped pool; later imports hit the cache."""

0 commit comments

Comments
 (0)