-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixed test failure in windows ie, testEcho()
method
#119
base: main
Are you sure you want to change the base?
Conversation
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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