Skip to content

Commit 69f3412

Browse files
authored
Adds a unit tests for catching non-headless app file launch (#3392)
# Description Recent isaac sim update introduced a new bug for non-headless scripts where some scripts were hanging at simulation startup. This change introduces a new unit test that aims to capture issues like this by forcing the use of the non-headless app file. Additionally, the isaac sim CI system has very unstable results for perf testing, so we are disabling the performance-related tests for the sim CI. ## Type of change - Bug fix (non-breaking change which fixes an issue) ## Checklist - [x] I have run the [`pre-commit` checks](https://pre-commit.com/) with `./isaaclab.sh --format` - [x] I have made corresponding changes to the documentation - [x] My changes generate no new warnings - [x] I have added tests that prove my fix is effective or that my feature works - [ ] I have updated the changelog and the corresponding version in the extension's `config/extension.toml` file - [ ] I have added my name to the `CONTRIBUTORS.md` or my name already exists there <!-- As you go through the checklist above, you can mark something as done by putting an x character in it For example, - [x] I have done this task - [ ] I have not done this task -->
1 parent 994979c commit 69f3412

File tree

3 files changed

+65
-4
lines changed

3 files changed

+65
-4
lines changed
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
# Copyright (c) 2022-2025, The Isaac Lab Project Developers (https://github.com/isaac-sim/IsaacLab/blob/main/CONTRIBUTORS.md).
2+
# All rights reserved.
3+
#
4+
# SPDX-License-Identifier: BSD-3-Clause
5+
6+
"""
7+
This script checks if the app can be launched with non-headless app and start the simulation.
8+
"""
9+
10+
"""Launch Isaac Sim Simulator first."""
11+
12+
13+
import pytest
14+
15+
from isaaclab.app import AppLauncher
16+
17+
# launch omniverse app
18+
app_launcher = AppLauncher(experience="isaaclab.python.kit", headless=True)
19+
simulation_app = app_launcher.app
20+
21+
"""Rest everything follows."""
22+
23+
import isaaclab.sim as sim_utils
24+
from isaaclab.assets import AssetBaseCfg
25+
from isaaclab.scene import InteractiveScene, InteractiveSceneCfg
26+
from isaaclab.utils import configclass
27+
28+
29+
@configclass
30+
class SensorsSceneCfg(InteractiveSceneCfg):
31+
"""Design the scene with sensors on the robot."""
32+
33+
# ground plane
34+
ground = AssetBaseCfg(prim_path="/World/defaultGroundPlane", spawn=sim_utils.GroundPlaneCfg())
35+
36+
37+
def run_simulator(
38+
sim: sim_utils.SimulationContext,
39+
):
40+
"""Run the simulator."""
41+
42+
count = 0
43+
44+
# Simulate physics
45+
while simulation_app.is_running() and count < 100:
46+
# perform step
47+
sim.step()
48+
count += 1
49+
50+
51+
@pytest.mark.isaacsim_ci
52+
def test_non_headless_launch():
53+
# Initialize the simulation context
54+
sim_cfg = sim_utils.SimulationCfg(dt=0.005)
55+
sim = sim_utils.SimulationContext(sim_cfg)
56+
# design scene
57+
scene_cfg = SensorsSceneCfg(num_envs=1, env_spacing=2.0)
58+
scene = InteractiveScene(scene_cfg)
59+
print(scene)
60+
# Play the simulator
61+
sim.reset()
62+
# Now we are ready!
63+
print("[INFO]: Setup complete...")
64+
# Run the simulator
65+
run_simulator(sim)

source/isaaclab/test/performance/test_kit_startup_performance.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,9 @@
1010

1111
import time
1212

13-
import pytest
14-
1513
from isaaclab.app import AppLauncher
1614

1715

18-
@pytest.mark.isaacsim_ci
1916
def test_kit_start_up_time():
2017
"""Test kit start-up time."""
2118
start_time = time.time()

source/isaaclab/test/performance/test_robot_load_performance.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@
3333
({"name": "Anymal_D", "robot_cfg": ANYMAL_D_CFG, "expected_load_time": 40.0}, "cpu"),
3434
],
3535
)
36-
@pytest.mark.isaacsim_ci
3736
def test_robot_load_performance(test_config, device):
3837
"""Test robot load time."""
3938
with build_simulation_context(device=device) as sim:

0 commit comments

Comments
 (0)