Skip to content

Fix native server session lease test - #2118

Closed
justinchuby wants to merge 1 commit into
mainfrom
justinchuby/fix-native-session-lease-tests
Closed

justinchuby wants to merge 1 commit into
mainfrom
justinchuby/fix-native-session-lease-tests

Conversation

@justinchuby

Copy link
Copy Markdown
Owner

Summary

  • load the native fixture through AppState so its driver uses the production model-qualified session key
  • acquire generation leases through SessionRegistry and close through take_for_close
  • assert leases are released after generation and session close

Tests

  • cargo check -p onnx-genai-server --features native-backend --all-targets
  • cargo test -p onnx-genai-server --features native-backend --all-targets
  • cargo test -p onnx-genai-server --lib
  • cargo fmt --all -- --check
  • cargo clippy -p onnx-genai-server --features native-backend --all-targets -- -D warnings

Load the native server fixture through AppState so the driver carries its production model key, then bind, acquire, generate, and close through SessionRegistry lease APIs. Assert generation and close both release their leases.

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

Copy link
Copy Markdown
Owner Author

Closing as a duplicate after auditing #2114 and #2115. #2115 correctly accounts for the post-Finished lease-release race and is the implementation being validated.

@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 80.70%. Comparing base (c00aeb9) to head (bac8f4d).
⚠️ Report is 40 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #2118      +/-   ##
==========================================
+ Coverage   80.51%   80.70%   +0.19%     
==========================================
  Files         414      429      +15     
  Lines      200017   215150   +15133     
  Branches   200017   215150   +15133     
==========================================
+ Hits       161037   173638   +12601     
- Misses      33462    35741    +2279     
- Partials     5518     5771     +253     
Flag Coverage Δ
cli-ort-linux 72.51% <ø> (?)
cli-ort-windows 72.10% <ø> (?)
mlas 85.90% <ø> (?)
offline 80.83% <ø> (+0.31%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.
see 73 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.

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.

2 participants