Skip to content

test(ep-cpu): report the affinity-capability skip instead of returning silently - #2119

Merged
justinchuby merged 3 commits into
mainfrom
squad/gaff-report-affinity-skip
Aug 25, 2026
Merged

justinchuby merged 3 commits into
mainfrom
squad/gaff-report-affinity-skip

Conversation

@justinchuby

Copy link
Copy Markdown
Owner

a_successful_affinity_call_is_never_reported_as_an_unsupported_target returns silently when allowed_cpus() is None. Eight lines so that it says so.

The test's only failure mode is a target that masks successfully while AFFINITY_MASKING_SUPPORTED says it cannot. A run that never reached the call therefore proves nothing — but a bare return produces a log identical to a check that ran and passed. That is the fail-open shape this test was itself written to prevent, sitting in the test.

Honest scope

  • This is a log-only change. No assertion is added or altered.
  • The new branch does not execute on Linux CI: allowed_cpus() returns Some here, so the skip is not taken. I verified the test still passes (1 passed, and no skip line printed, which is the expected result and also the proof the branch was not hit). I am not claiming this line is covered — I am claiming that if it is ever hit, it will be visible.

Commands

cargo fmt --all -- --check                                    # clean
cargo test --locked -p onnx-runtime-ep-cpu --lib \
  a_successful_affinity_call_is_never_reported_as_an_unsupported_target -- --nocapture
# test result: ok. 1 passed; 0 failed

Salvaged from #2084, which I am closing as superseded by #2034.

…g silently

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@codecov

codecov Bot commented Aug 25, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 81.18%. Comparing base (272bd94) to head (b0f59c8).
⚠️ Report is 18 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #2119      +/-   ##
==========================================
+ Coverage   80.71%   81.18%   +0.46%     
==========================================
  Files         415      429      +14     
  Lines      205260   215175    +9915     
  Branches   205260   215175    +9915     
==========================================
+ Hits       165681   174686    +9005     
- Misses      34018    34717     +699     
- Partials     5561     5772     +211     
Flag Coverage Δ
cli-ort-linux 72.51% <ø> (?)
cli-ort-windows 72.01% <ø> (?)
mlas 85.90% <ø> (?)
offline 81.32% <100.00%> (+0.60%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
crates/onnx-runtime-ep-cpu/src/decode_affinity.rs 94.51% <100.00%> (-0.20%) ⬇️

... and 40 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@justinchuby
justinchuby merged commit 9c5886a into main Aug 25, 2026
21 checks passed
@justinchuby
justinchuby deleted the squad/gaff-report-affinity-skip branch August 25, 2026 17:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant