tests(cli/load): Add regression test for session killed during attach#1002
Closed
tests(cli/load): Add regression test for session killed during attach#1002
Conversation
9009b86 to
b67ee0d
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1002 +/- ##
=======================================
Coverage 72.97% 72.97%
=======================================
Files 26 26
Lines 1839 1839
Branches 347 347
=======================================
Hits 1342 1342
Misses 394 394
Partials 103 103 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Adds a regression test documenting the fix for TmuxObjectDoesNotExist being raised when a session is killed while the user is attached. The issue was caused by libtmux's Session.attach() calling refresh() after attach-session returned. This was fixed in libtmux by removing the semantically incorrect refresh() call. Test uses NamedTuple + parametrize + test_id pattern per project style. Related: libtmux 9a5147aa (introduced bug), tmuxp fdafdd2 (triggered it) Fix: libtmux PR #616
b67ee0d to
f21d577
Compare
tony
added a commit
to tmux-python/libtmux
that referenced
this pull request
Dec 14, 2025
…illed why: attach-session is a blocking interactive command where session state can change arbitrarily during attachment, including being killed entirely. Calling refresh() after such a command is semantically incorrect. what: - Remove self.refresh() call from Session.attach() Fixes: tmux-python/tmuxp#1002
Member
Author
|
#1003 will fix this via libtmux v0.53.0 |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Adds a regression test documenting the fix for
TmuxObjectDoesNotExistbeing raised when a session is killed while the user is attached viatmuxp load.User Experience
After running
tmuxp load, users would see this traceback printed to their terminal after detaching:Root Cause
The issue was caused by libtmux's
Session.attach()callingrefresh()afterattach-sessionreturned. Sinceattach-sessionis a blocking interactive command, the session state can change arbitrarily during attachment - including being killed entirely.Timeline
Session.attach()was added with therefresh()callattach_session()toattach()Fix
The fix is in libtmux: tmux-python/libtmux#616
This PR adds a regression test to tmuxp to ensure the behavior is documented and tested.
Test plan
tests/cli/test_load.pytests pass (26 passed, 1 skipped)test_load_attached_handles_session_killed_during_attachpassesRelated
Session.attach()): Removerefresh()call that fails after session killed libtmux#616