use of io.kestra.core.tasks.scripts.ScriptOutput in project kestra by kestra-io.
the class AbstractBashTest method longBashCreateTempFiles.
@Test
void longBashCreateTempFiles() throws Exception {
List<String> commands = new ArrayList<>();
for (int i = 0; i < 15000; i++) {
commands.add("if [ \"" + i + "\" -eq 0 ] || [ \"" + i + "\" -eq 14999 ]; then echo " + i + ";fi;");
}
Bash bash = configure(Bash.builder().commands(commands.toArray(String[]::new))).build();
RunContext runContext = TestsUtils.mockRunContext(runContextFactory, bash, ImmutableMap.of());
ScriptOutput run = bash.run(runContext);
assertThat(run.getExitCode(), is(0));
assertThat(run.getStdOutLineCount(), is(2));
assertThat(run.getStdErrLineCount() > 0, is(false));
}
Aggregations