tests(cli/load): Add regression test for session killed during attach #1002
+80
−0
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