Skip to content

Adds distinct exit codes for crashed, hung and failing test runs - #7235

Merged
myurasov-nv merged 2 commits into
isaac-sim:developfrom
myurasov-nv:myurasov/distinct-ci-failure-exit-codes
Aug 21, 2026
Merged

myurasov-nv merged 2 commits into
isaac-sim:developfrom
myurasov-nv:myurasov/distinct-ci-failure-exit-codes

Conversation

@myurasov-nv

Copy link
Copy Markdown
Member

Description

Every failure mode in the individual-test orchestrator exits 1, so a crashed process, a hung test, and a failing assertion cannot be told apart from the exit code. The orchestrator already separates them internally: it counts Failing, Crashed, Startup Hang, and Timeout, and prints each in the result summary. This carries that distinction into the exit code and prints the resolved code with a label.

1 still means failing assertions. A crashed process is 20, a timeout 21, and a startup hang 22. When a run hits more than one, the code reports the outcome that proved the least, so a crash outranks a timeout, which outranks a startup hang. 0 is unchanged, and callers that only check for a non-zero code are unaffected.

Before After
A lost GPU, a 1000 second hang, and a pixel mismatch all end in Process completed with exit code 1 The same 3 runs exit 20, 21, and 1, each printed as Exit Code: N (label) in the summary

Reproduction

  1. Run a suite through the orchestrator and read the exit code:

    ./isaaclab.sh -p -m pytest --ignore=tools/conftest.py tools -v --junitxml=tests/report.xml; echo "exit=$?"
    
  2. Make one file reach its hard timeout, by lowering the timeout for that file or running a test that sleeps past it.

    Observed before this change: the summary reports Timeout: 1 while the run reports exit=1, the same code a failing assertion produces.

  3. Repeat with this change.

    Observed: the summary reports Exit Code: 21 (timeout) and the run reports exit=21, while a run whose only failures are assertions still reports exit=1.

Type of change

  • New feature (non-breaking change which adds functionality)

Screenshots

Not applicable; the change has no rendered output.

Checklist

  • I have read and understood the contribution guidelines
  • I have run the pre-commit checks with ./isaaclab.sh --format: not run; no dev setup on this machine. The diff was checked by hand for line length and whitespace, and python3 -m py_compile tools/conftest.py passes
  • I have made corresponding changes to the documentation: not applicable; each code is documented where it is defined and printed in the run summary
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works: not added; the counters are computed inside pytest_sessionstart, and tools/conftest.py takes over any pytest session that loads it, so a test in the same directory cannot drive this path in-process. resolve_exit_code was instead checked over all 16 combinations of the 4 counters, confirming that each mode maps to its own code and that zero versus non-zero matches the previous expression exactly
  • I have added a changelog fragment under source/<pkg>/changelog.d/ for every touched package (do not edit CHANGELOG.rst or bump extension.toml — CI handles that): not applicable; no package under source/ is touched
  • I have added my name to the CONTRIBUTORS.md or my name already exists there

@myurasov-nv
myurasov-nv marked this pull request as ready for review August 21, 2026 04:32
@myurasov-nv
myurasov-nv requested a review from a team August 21, 2026 04:32
@greptile-apps

greptile-apps Bot commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

The PR gives crashed, timed-out, startup-hung, and assertion-failing orchestrator runs distinct process exit codes while preserving zero for successful runs.

  • Adds named exit-code constants and human-readable labels.
  • Resolves mixed outcomes using the documented crash, timeout, startup-hang, then assertion-failure precedence.
  • Prints the selected code in the run summary and returns it through pytest.exit.

Confidence Score: 5/5

The PR appears safe to merge with no actionable correctness, compatibility, or security issue identified.

The new resolver receives the counters in the correct order, follows the precedence documented by the change, and preserves the existing success-versus-failure behavior for callers that treat any nonzero status as failure.

Important Files Changed

Filename Overview
tools/conftest.py Adds distinct, labeled exit statuses for existing mutually exclusive outcome counters and propagates the selected status from the custom pytest orchestrator.

Reviews (1): Last reviewed commit: "Adds distinct exit codes for crashed, hu..." | Re-trigger Greptile

@isaaclab-review-bot isaaclab-review-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isaac Lab Review Bot

The change centralizes failure-mode exit-code selection in tools/conftest.py and reports the selected code and label in the existing test summary. The exact nonzero exit-code contract intentionally changes for crashes, timeouts, and startup hangs, while success remains 0 and assertion failures remain 1.

  • Design and architecture: The precedence rule (crash, timeout, startup hang, assertion failure) is isolated in one helper and reused for both summary reporting and pytest.exit, preventing those two paths from diverging. The change remains scoped to the test orchestrator and adds no dependencies or package coupling.
  • API: Checked the externally observable process-exit contract: all successful runs still return 0, assertion-only failures still return 1, and the newly distinguished failure modes return 20–22. Consumers that only distinguish zero from nonzero remain compatible, while consumers matching exactly on 1 will observe the intentional contract change. No source package or public package API is modified.
  • Implementation: The helper call uses the same counter order as its signature, its precedence matches the stated behavior, and the label mapping covers every possible return value. The final resolved value is consistently used in both the logged summary and pytest.exit. The helper lacks type annotations and detailed argument documentation, but that is a non-blocking consistency tradeoff rather than a demonstrated defect.

No blocking issues. No inline issue met the actionable-evidence threshold; the assessment above records the review feedback.

Automated review; human maintainers own approval decisions.

@myurasov-nv

Copy link
Copy Markdown
Member Author

Dear Isaac Lab Review Bot!

resolve_exit_code now carries int annotations on its 4 counters and on its return value, plus an Args block describing each counter and a Returns line stating the precedence, in commit 30f2613. That matches the annotated helpers already in this file, such as _merge_pass_status and _format_test_file_results.

On the contract change: it is intended, and it is limited to the 3 modes that previously could not be told apart. The consumers I checked do not match on exactly 1, since run_tests.sh compares the container status against 0 and returns it unchanged, and the composite action fails on any non-zero step. I did not audit consumers outside this repository.

@myurasov-nv

Copy link
Copy Markdown
Member Author

Existing CI failures:

Failure Status Likely Reason
rendering-correctness-kitless (legacy) Not from this PR 37 golden-image comparison failures on franka_cable, franka_cloth and franka_soft. The same check is currently failing on open PRs 7233, 7228 and 7220.

The JUnit report for the failing run (32447613867) holds 314 cases with 37 failures, 0 errors, and no timeouts or crashes. Every failure is a pixel-percentage or SSIM threshold on a golden image. This change cannot affect that: it alters the process exit code and one line of the run summary, nothing in the render path.

Worth noting for this PR specifically: those 37 failures are ordinary assertion failures, so they resolve to exit code 1, the value the previous expression also returned.

develop is green (run 32449678669), but the push path runs the reduced .github/test-subsets/postmerge-rendering.toml subset and so does not exercise these files. Nothing was changed on this branch in response.

@myurasov-nv
myurasov-nv merged commit 4fa20fc into isaac-sim:develop Aug 21, 2026
44 of 46 checks passed
kellyguo11 added a commit that referenced this pull request Aug 26, 2026
## Description

Backports five merged `develop` PRs not already represented on
`release/3.0.0` or covered by #7300:

| Source PR | Source commit | Backport commit | Scope |
| --- | --- | --- | --- |
| #7235 | `4fa20fc8a5f` | `8110c816d0a` | Report distinct exit codes for
failed, crashed, timed-out, and startup-hung test runs. |
| #6597 | `2ae0878a266` | `68b21a60158` | Correct the stale
wheel-builder dependency-pin reference. |
| #7320 | `7ed3ad45546` | `1a775d46fcf` | Add success-driven ADR
guidance and evaluation coverage to the domain-randomization skill. |
| #7319 | `2c07bbb43a9` | `4249489a089` | Vectorize clone-plan
environment-ID queries. |
| #7316 | `a00278f0fde` | `8af682bfcb9` | Extend Core Lift and Reorient
episodes and pose-command resampling intervals. |

Each merged source commit was cherry-picked with `-x`. All five applied
without conflicts and have stable patch IDs identical to their source
commits.

#7233 is intentionally excluded because its existing backport is #7300.

## Type of change

- Bug fix
- Performance improvement
- Task configuration update
- Developer tooling improvement
- Documentation update

## Validation

- `uv run --frozen --extra test python -m pytest -q
source/isaaclab/test/cloner/test_clone_plan_algebra.py` — 85 passed.
- Validated the six representative `resolve_exit_code` outcomes,
including mixed-failure precedence.
- `uv run --no-project python tools/skills/cli.py check` — 21 skills
validated.
- `uv run --frozen --extra test python -m pytest --noconftest -q
source/isaaclab_tasks/test/core/test_lift_env_cfg.py` — 3 passed.
- Programmatic Lift/Reorient config assertions confirmed the 4–6 second
resampling interval and 12-second episode length.
- Ruff, Ruff-format, and RST hooks passed for the #7316 paths.
- The original four-PR branch passed
`ISAACLAB_CHANGELOG_BASE_REF=release/3.0.0 uv run --frozen isaaclab -f`;
#7316's source commit also passed its full formatting and changelog
validation.
- `git diff --check
kelly/kellyg/backport-remaining-develop-prs-3.0.0...HEAD` — passed for
the added #7316 commit.
- Stable patch IDs match all five merged source commits; #7316 also has
exact mode/blob parity on both affected paths.

## Screenshots

Not applicable.

## Checklist

- [x] I have read and understood the contribution guidelines.
- [x] I have run the repository formatting or focused pre-commit checks
appropriate to each source PR.
- [x] Documentation and skill guidance from the source PRs are included
unchanged.
- [x] My changes generate no new warnings.
- [x] Existing and backported tests cover the changed behavior.
- [x] Touched release-managed source packages carry their source
changelog fragments.
- [x] Source authorship and `-x` provenance are preserved.

---------

Co-authored-by: myurasov-nv <[email protected]>
Co-authored-by: AntoineRichard <[email protected]>
Co-authored-by: ooctipus <[email protected]>
Co-authored-by: camevor <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant