fix(itests): disable PTY in SSH test channels to fix garbled output on Windows#2544
Open
jbonofre wants to merge 2 commits intoapache:mainfrom
Open
fix(itests): disable PTY in SSH test channels to fix garbled output on Windows#2544jbonofre wants to merge 2 commits intoapache:mainfrom
jbonofre wants to merge 2 commits intoapache:mainfrom
Conversation
…ed output on Windows With a PTY allocated, JLine on the server side runs in interactive mode and re-renders each character as it is typed, producing garbled output (e.g. "conficonfigconfig:property-set") on Windows where I/O flush timing differs from Linux/macOS. Using setUsePty(false) keeps the server in dumb/non-interactive mode so the raw command output is captured cleanly regardless of platform. Fixes ConfigSshCommandSecurityTest.testConfigCommandSecurityWithoutEditSessionViaSsh on Windows.
…from hanging Without PTY allocation, the logout command alone does not reliably trigger a channel-close on the server side. Closing the PipedOutputStream sends EOF on stdin so the Karaf shell exits cleanly regardless of PTY mode. Also replace the infinite waitFor(0) with a 15-second timeout as a safety net to avoid tests hanging and Surefire killing the JVM fork.
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.
SshCommandTestBase.openSshChannelpreviously allocated a pseudo-terminal (PTY) for the shell channel, even though all tests use it for scripted (non-interactive) command execution.conficonfigconfig:property-setin the captured output stream.setPtyModes(PtyMode.ECHO, 0)) disabled terminal echo but still allocated a PTY, so JLine's display-refresh writes continued to pollute the output.channel.setUsePty(false)(available in Apache MINA SSHDPtyCapableChannelSession) so no PTY is requested and JLine runs in dumb/non-interactive mode — the raw command output is then captured cleanly on all platforms.