Skip to content

Conversation

@tufantunc
Copy link
Owner

No description provided.

- Added SSHConnectionManager class to maintain a single SSH connection
- Connection is automatically established on first command and reused for subsequent commands
- Implements automatic reconnection if connection is lost
- Added graceful shutdown handling to properly close connections
- Kept old execSshCommand function for backward compatibility with tests
- Reduces connection overhead and improves performance for multiple commands
- Created 26 new tests covering all aspects of SSHConnectionManager
- Unit tests: initialization, connection state management, cleanup
- Integration tests: connection reuse, reconnection, concurrent commands
- Connection lifecycle tests: multiple managers, proper cleanup
- Error handling tests: invalid config, timeouts, command errors
- Tests verify connection reuse across multiple commands
- Tests verify auto-reconnection after connection loss
- Tests verify concurrent command execution
- All 39 tests in the suite now pass successfully
@tufantunc tufantunc self-assigned this Oct 12, 2025
@tufantunc tufantunc merged commit cc0a2cd into main Oct 12, 2025
2 checks passed
@tufantunc tufantunc deleted the feature/persistent-ssh-connection branch October 12, 2025 14:16
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