Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file.
17 changes: 15 additions & 2 deletions source/isaaclab_rl/test/export/test_leapp_export_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

from __future__ import annotations

import os
import subprocess
import sys
import tempfile
Expand All @@ -27,8 +28,10 @@
_SUBPROCESS_TIMEOUT = 600
_CHECKPOINT_BATCH_TIMEOUT = 1200
_OUTPUT_TAIL_CHARS = 5000
# TODO: Remove once usd-core>=26.5 is the minimum. Earlier OpenUSD releases
# can corrupt the heap while parsing the Newton Franka payload concurrently.
# TODO: Remove once usd-core>=26.5 is the minimum. Earlier OpenUSD releases can
# corrupt the heap while parsing the Newton Franka payload concurrently. OpenUSD
# reads PXR_WORK_THREAD_LIMIT during process startup, before AppLauncher can apply
# its matching SimulationApp limit.
_LEAPP_TEST_CPU_THREAD_LIMIT = 1


Expand Down Expand Up @@ -132,6 +135,7 @@ def _run_checked(
list(cmd),
cwd=_REPO_ROOT,
capture_output=True,
env={**os.environ, "PXR_WORK_THREAD_LIMIT": str(_LEAPP_TEST_CPU_THREAD_LIMIT)},
text=True,
timeout=timeout,
)
Expand Down Expand Up @@ -266,6 +270,15 @@ def test_initialized_checkpoints(initialized_checkpoints: Path):
assert not missing, f"Missing initialized checkpoints for: {', '.join(missing)}"


def test_openusd_thread_limit_is_set_before_subprocess_startup():
"""Assert LEAPP subprocesses start with OpenUSD concurrency disabled."""
result = _run_checked(
[sys.executable, "-c", "import os; print(os.environ['PXR_WORK_THREAD_LIMIT'])"],
label="OpenUSD thread-limit probe",
)
assert result.stdout.strip() == str(_LEAPP_TEST_CPU_THREAD_LIMIT)


@pytest.mark.parametrize(("backend", "task_name"), _export_cases())
def test_leapp_export_flow(backend: ExportFlowBackend, task_name: str, initialized_checkpoints: Path):
"""Export one backend/task pair using the shared initialized checkpoint."""
Expand Down
Loading