Skip to content

TDD: Track session state post-close access in tests #1905

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed

Conversation

yellowhatter
Copy link
Contributor

This PR is for discussion and adds panic in tests if Session internal state is accessed after Session is being closed. I believe that to have proper design we should make this work

@yellowhatter yellowhatter self-assigned this Apr 15, 2025
Copy link

PR missing one of the required labels: {'breaking-change', 'bug', 'documentation', 'dependencies', 'new feature', 'internal', 'enhancement'}

@yellowhatter yellowhatter added the enhancement Existing things could work better label Apr 15, 2025
Copy link

codecov bot commented Apr 15, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 71.07%. Comparing base (037c546) to head (ff74d91).
Report is 23 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1905      +/-   ##
==========================================
- Coverage   71.25%   71.07%   -0.19%     
==========================================
  Files         364      364              
  Lines       65708    65714       +6     
==========================================
- Hits        46823    46707     -116     
- Misses      18885    19007     +122     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@wyfo
Copy link
Contributor

wyfo commented Apr 22, 2025

Accessing SessionState after session close is perfectly valid. Session::close takes a shared reference, so when the session will be dropped after having been closed, it will access the state and raise an error with your PR — I guess that's not expected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Existing things could work better
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants