SQL: Ignore environment in CliFixture

If the currenct environment contains `JAVA_TOOLS` then the cli tests
will fail because they do not expect the notification about `JAVA_TOOLS`
that java prints to stdout. The clears the environment before starting
the CLI subprocess in an effort to remove the unexpected output.

Original commit: elastic/x-pack-elasticsearch@5729c1c09b
This commit is contained in:
Nik Everett 2017-12-11 16:40:24 -05:00
parent c27332be4a
commit 6d56616d98
1 changed files with 2 additions and 0 deletions

View File

@ -102,6 +102,8 @@ public class CliFixture {
command.add(cliJar.toString());
command.addAll(Arrays.asList(line.split(" ")));
ProcessBuilder cliBuilder = new ProcessBuilder(command);
// Clear the environment to drop JAVA_TOOLS which prints strange things on startup
cliBuilder.environment().clear();
cliBuilder.redirectErrorStream(true);
Process process = cliBuilder.start();
println("started " + command);