Fixed test failure in windows ie, testEcho() method#119
Fixed test failure in windows ie, testEcho() method#119Kshitiz-Mhto wants to merge 8 commits intostarfixdev:mainfrom
testEcho() method#119Conversation
|
Didn't get u here. Thought issue was around some text formatting? What was the actual isssue acc to you? How does using a process builder instead of process executor fix it? |
|
i thought the same first, that issue is causing due to some text formatting in windows. But using
so i went for the alternative choice using ProcessBuilder to run external command and it worked fine... |
|
can u plz try figuring out what's the issue with ProcessExecutor here? we should have a very valid reason when discarding ProcessExecutor and moving to ProcessBuilder imo . |
no problem, i m going to figure this out. |
|
@fahad-israr done 👍. I fixed it using ProcessExecutor. |
|
| if (isWindows()) { | ||
| try{ | ||
| System.out.println("Running " + String.join(" ", command)); | ||
| presult = new ProcessExecutor().command("CMD", "/C", command[0], command[1]).redirectOutput(System.out).redirectErrorStream(true).readOutput(true) |
There was a problem hiding this comment.
why are you assuming that commands array will be of max size 2. can't there be more args than that ?
Infact there itself look at the gitClone Function which is calling run command with how many args:
runCommand(directory.getParent(), "git", "clone", originUrl, directory.toString());
There was a problem hiding this comment.
my mistake. its done now I think.
|
Zut process executor is afaik still the best around when it comes to manage the handling of input and output streams. It takes care of the threads currently today required to be used to get output and empty/close the streams. Which you need to do especially on windows where a process won't even execute if you don't continuously empty the stream. |
part of fixing #104