You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
test(cuda.core): retry all failed tests after confirmed sticky OOM - #3704
The invalid Windows driver state that produces false CUDA OOMs may also cause failures that don't look like OOMs, including before the first test that lets us confirm the state. The retry policy assumes that genuine test failures are deterministic: they will recur in a fresh process even when previously completed tests are skipped. An intermittent or order-dependent failure can therefore be masked by a successful restart. This tradeoff applies only after the sticky-OOM probe confirms the driver state; ordinary failures do not trigger a restart.
Changes
Retry failed tests after confirmed sticky OOM, regardless of the error they reported. Only tests that completed without a reported failure or pending rerun are written to the resume file. The triggering test is also left out, even if an in-process rerun passed. The fresh process reruns these tests and determines the result; the .failed sidecar no longer forces a failure based on the discarded attempt. Each attempt still emits its own JUnit report for diagnosis.
Use the exception to decide whether to probe for sticky OOM. OOM text in a source line or comment no longer makes a setup or call failure look like OOM. An exception group qualifies only if all its underlying exception messages contain the marker.
Preserve log-folding failures across attempts. If pytest eventually exits successfully, the wrapper still returns a log-folding failure from any attempt.
Verification
Subprocess regression tests simulate an earlier non-OOM failure followed by confirmed sticky OOM. The restart skips the completed test, retries both failed tests, and passes only if the earlier failure clears. A negative probe leaves the original pytest failure intact.
Five sticky-OOM tests, nine log-folding tests, and four shell-wrapper exit-code scenarios passed. Bash syntax and Ruff checks passed. The driver probe was simulated; this was not tested against a live Windows driver.
Follow-up to NVIDIA#3695, addressing the remaining CodeRabbit findings.
- A test whose call failed for a reason other than OOM and then hit an
OOM in teardown was left unfinished so it reruns, but its real failure
was dropped: a pass after the restart turned the run green. Such a test
is now also listed in the .failed file.
- run_pytest_with_restarts ignored a log-folding failure in an attempt
that exited with the sticky-OOM code. A fold failure in any attempt now
fails the run.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
juenglin
changed the title
test(cuda.core): rerun tests that failed with OOM before a sticky-OOM restart
test(cuda.core): keep non-OOM failures across a sticky-OOM restart
Dec 3, 2026
Test runs now retain and report log-folding failures even if a later attempt passes.
Sticky-OOM restarts are limited to confirmed OOM failures, while other pytest exit codes are preserved.
Completion tracking now better distinguishes unfinished tests from tests that completed successfully.
Tests
Added coverage for sticky-OOM detection, restart outcomes, completed-test tracking, and grouped exception classification.
The test runner now retains log-folding failures across attempts. Test hooks classify OOM failures and track unfinished tests. The sticky-OOM helper records completed test IDs without writing failed test IDs. New tests cover restart behavior and exception-group classification.
Changes: Test failure tracking
Layer / File(s)
Summary
Classify OOM failures and track completion cuda_core/tests/helpers/sticky_oom.py, cuda_core/tests/conftest.py, cuda_core/tests/test_sticky_oom.py
The helper classifies failed reports, including exception groups, and records completed test IDs. The hooks use OOM classification when probing for a stuck driver and track unfinished nodes. Tests cover sticky-OOM restart outcomes and exception-group classification.
Preserve log-folding failures across attempts ci/tools/run-tests
run_pytest_with_restarts remembers folding failures across attempts. If pytest passes after a non-sticky-OOM exit, it returns the remembered folding error. Otherwise, it returns pytest’s exit code.
Suggested reviewers:rwgk, andy-jost
Change: Bug fix
Merge Risk: Moderate · up to ae847
A real non-OOM test failure can be masked in CI when a sticky-OOM restart is followed by a passing rerun, which gives a false green result. The wrapper and tests need to preserve that failure before merge.
Security architecture risk: Low · up to ae847
A Windows cuda.core CI run can report success after a sticky-OOM restart even though an earlier pytest process reported a non-OOM failure. Retrying unfinished tests is useful, and the change correctly preserves log-folding errors, but a passing retry should not erase a failure the PR says it will preserve.
Retained concerns
Minor · reliability · inferred: The PR intends to rerun unfinished tests without losing reported non-OOM failures, but the reviewed code removes the cross-process failure record. If an earlier non-OOM failure would have been recorded at the merge base, a later sticky-OOM stop followed by a passing retry can now make the wrapper return success. Keep restart selection separate from failure status so a test can rerun without clearing the earlier failure.
inferred — The demonstrated impact is on the exit status of a cuda.core CI suite that enters sticky-OOM recovery. Consumers that use only the wrapper’s status can miss a failure; the wrapper still requests separate JUnit reports for each attempt.
Trust Boundaries and Controls
observed — The exception classifier checks exception messages rather than rendered tracebacks and requires every leaf of an exception group to match the OOM marker. The Windows driver probe remains a separate condition for requesting a sticky stop.
Dependencies
observed — Completion tracking uses reports delivered to pytest_runtest_logreport after pytest-rerunfailures may relabel an outcome. The hook can track failed or rerun reports it receives; it cannot preserve a report the plugin does not deliver.
Data and control flow
observed — The wrapper clears the suite’s completion file on entry and passes the same path to each sequential attempt. Pytest appends eligible completed node IDs and deselects those IDs on the next collection. A missing node ID does not distinguish a test that never ran from one that failed and must rerun.
Resilience and Maintainability Implications
observed — An earlier log-folding failure now survives a retry and is returned if pytest eventually passes. A terminal nonzero pytest status still takes precedence, and the wrapper stops after three restarts.
inferred — Retrying an OOM-only failure in a fresh process can legitimately end green. But after replay, the wrapper cannot distinguish that history from one with an earlier reported non-OOM failure if both end with a passing pytest result and no log-folding error.
observed — As at the merge base, once the sticky-stop flag is set, the session hook can translate an unrelated interruption into exit 75. The retry budget bounds automatic recovery, but exit 75 does not prove the sticky stop was the only reason the session ended.
Hardening Proposals
proposed — Keep a run-scoped record of reported non-OOM failures separate from completion, and have the wrapper consult it before returning success. Cover both a passing retry after a reported non-OOM failure and a passing OOM-only retry at the wrapper exit-code boundary.
Rollout and rollback
inferred — There is no new operator step to start recovery: pytest still requests the stop and the wrapper still owns the retry budget. The wrapper no longer treats an earlier .failed record as a reason to reject success. Until the failure record is restored, an operator who needs to verify a recovered run must check earlier attempt reports rather than rely on the final exit code alone.
- [ ] Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Treat non-OOM failures from a poisoned driver process as provisional. Checkpoint only completed non-failing tests and let failures that reproduce in a fresh process determine the CI result.
Signed-off-by: Ralf Juengling <rjuengling@nvidia.com>
juenglin
changed the title
test(cuda.core): keep non-OOM failures across a sticky-OOM restart
test(cuda.core): retry all failed tests after confirmed sticky OOM
Dec 3, 2026
The PR intends to rerun unfinished tests without losing reported non-OOM failures, but the reviewed code removes the cross-process failure record. If an earlier non-OOM failure would have been recorded at the merge base, a later sticky-OOM stop followed by a passing retry can now make the wrapper return success. Keep restart selection separate from failure status so a test can rerun without clearing the earlier failure.
Reviewing files that changed from the base of the PR and between 3749c99 and ae847a3.
Files selected for processing: 4
ci/tools/run-tests
cuda_core/tests/conftest.py
cuda_core/tests/helpers/sticky_oom.py
cuda_core/tests/test_sticky_oom.py
Included review availability: This review used your included allowance. Your plan provides up to 12 included reviews per hour; 9 remain after this review.
Preview will be ready when the GitHub Pages deployment is complete.
This branch has not been deployed
No deployments
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CI/CDCI/CD infrastructurecuda.coreEverything related to the cuda.core module
2 participants
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #3695 and its CodeRabbit review. Part of #3472 / NVBugs 7092346.
Retry policy
The invalid Windows driver state that produces false CUDA OOMs may also cause failures that don't look like OOMs, including before the first test that lets us confirm the state. The retry policy assumes that genuine test failures are deterministic: they will recur in a fresh process even when previously completed tests are skipped. An intermittent or order-dependent failure can therefore be masked by a successful restart. This tradeoff applies only after the sticky-OOM probe confirms the driver state; ordinary failures do not trigger a restart.
Changes
.failedsidecar no longer forces a failure based on the discarded attempt. Each attempt still emits its own JUnit report for diagnosis.Verification