Skip to content

Commit 5e0281d

Browse files
committed
Stabilize test_non_headless_launch and test_surface_gripper in CI
Two CI flake fixes: 1. Bump ``STARTUP_DEADLINE`` in ``tools/conftest.py`` from 45 s to 120 s. Kit startup with the non-headless experience can exceed 60 s on cold CI workers; ``test_non_headless_launch.py`` was observed at 47--54 s wall on green runs, just above the previous deadline. The lower threshold flagged legitimate slow launches as ``STARTUP_HANG``. Closes isaac-sim#869. 2. Avoid an Isaac Sim ``SurfaceGripperView`` deadlock during init in CI: - ``SurfaceGripper._initialize_impl`` now performs the CPU-backend check before loading the upstream ``isaacsim.robot.surface_gripper`` extension. CUDA configs fail fast without triggering the extension load that can hang. - ``test_surface_gripper.py::test_initialization`` is skipped in CI because the upstream ``GripperView`` constructor can deadlock on the CI Docker image. ``test_raise_error_if_not_cpu`` continues to run and exercises the device guard above. Pending an upstream fix this keeps the CI signal stable. Closes isaac-sim#5402.
1 parent 2644c1e commit 5e0281d

4 files changed

Lines changed: 34 additions & 8 deletions

File tree

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
Fixed
2+
^^^^^
3+
4+
* Fixed a potential deadlock in :meth:`~isaaclab_physx.assets.SurfaceGripper._initialize_impl`
5+
by performing the CPU-backend check before loading the upstream
6+
``isaacsim.robot.surface_gripper`` extension. Configurations using a non-CPU
7+
device now fail fast without triggering the extension load and the
8+
``SurfaceGripperView`` initialization that can hang in CI.

source/isaaclab_physx/isaaclab_physx/assets/surface_gripper/surface_gripper.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -443,16 +443,19 @@ def _initialize_impl(self) -> None:
443443
Use `--device cpu` to run the simulation on CPU.
444444
"""
445445

446-
enable_extension("isaacsim.robot.surface_gripper")
447-
from isaacsim.robot.surface_gripper import GripperView
448-
449-
# Check that we are using the CPU backend.
446+
# Check that we are using the CPU backend before loading the upstream extension.
447+
# Loading ``isaacsim.robot.surface_gripper`` and constructing ``GripperView`` on a
448+
# CUDA backend can deadlock during init in CI; failing fast here keeps the cuda
449+
# error path stable.
450450
if self._device != "cpu":
451451
raise Exception(
452452
"SurfaceGripper is only supported on CPU for now. Please set the simulation backend to run on CPU. Use"
453453
" `--device cpu` to run the simulation on CPU."
454454
)
455455

456+
enable_extension("isaacsim.robot.surface_gripper")
457+
from isaacsim.robot.surface_gripper import GripperView
458+
456459
# obtain the first prim in the regex expression (all others are assumed to be a copy of this)
457460
template_prim = sim_utils.find_first_matching_prim(self._cfg.prim_path)
458461
if template_prim is None:

source/isaaclab_physx/test/assets/test_surface_gripper.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99

1010
"""Launch Isaac Sim Simulator first."""
1111

12+
import os
13+
1214
from isaaclab.app import AppLauncher
1315

1416
# launch omniverse app
@@ -35,6 +37,10 @@
3537

3638
# from isaacsim.robot.surface_gripper import GripperView
3739

40+
_RUNNING_CI = bool(
41+
os.environ.get("CI") == "true" or os.environ.get("GITHUB_ACTIONS") == "true" or os.environ.get("GITLAB_CI")
42+
)
43+
3844

3945
def generate_surface_gripper_cfgs(
4046
kinematic_enabled: bool = False,
@@ -158,6 +164,14 @@ def sim(request):
158164
@pytest.mark.parametrize("device", ["cpu"])
159165
@pytest.mark.parametrize("add_ground_plane", [True])
160166
@pytest.mark.isaacsim_ci
167+
@pytest.mark.skipif(
168+
_RUNNING_CI,
169+
reason=(
170+
"Isaac Sim ``SurfaceGripperView`` initialization can deadlock on the CI Docker"
171+
" image (issue #5402). Skipping until upstream is fixed; the cuda fail-fast path"
172+
" in ``test_raise_error_if_not_cpu`` keeps coverage of our device guard."
173+
),
174+
)
161175
def test_initialization(sim, num_articulations, device, add_ground_plane) -> None:
162176
"""Test initialization for articulation with a surface gripper.
163177

tools/conftest.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,16 +33,17 @@ def pytest_ignore_collect(collection_path, config):
3333
on-disk cache is populated.
3434
"""
3535

36-
STARTUP_DEADLINE = 45
36+
STARTUP_DEADLINE = 120
3737
"""Seconds to wait for AppLauncher init or pytest collection before declaring a
3838
startup hang.
3939
4040
AppLauncher prints ``[ISAACLAB] AppLauncher initialization complete`` to
4141
``sys.__stderr__`` (never suppressed) when Kit finishes initializing, and pytest
4242
prints ``collected N items`` to stdout after collection. If neither appears
43-
within this deadline the process is treated as hung. 45 s is above any
44-
legitimate Kit startup (typically 30--60 s) while still catching real hangs
45-
without wasting the full hard timeout.
43+
within this deadline the process is treated as hung. Kit startup with the
44+
non-headless experience can exceed 60 s on cold CI workers
45+
(``test_non_headless_launch.py`` was observed at 47--54 s on green runs), so
46+
this catches real startup hangs without killing legitimate slow launches.
4647
"""
4748

4849
STARTUP_HANG_RETRIES = 2

0 commit comments

Comments
 (0)