azagrebin commented on a change in pull request #11545:
[FLINK-16742][runtime][dist] Extend and use BashJavaUtils to start JM JVM
process and pass JVM memory args
URL: https://github.com/apache/flink/pull/11545#discussion_r402314040
##########
File path:
flink-dist/src/test/java/org/apache/flink/dist/BashJavaUtilsITCase.java
##########
@@ -36,14 +37,37 @@
public class BashJavaUtilsITCase extends JavaBashTestBase {
private static final String RUN_BASH_JAVA_UTILS_CMD_SCRIPT =
"src/test/bin/runBashJavaUtilsCmd.sh";
+ private static final String RUN_EXTRACT_LOGGING_OUTPUTS_SCRIPT =
"src/test/bin/runExtractLoggingOutputs.sh";
@Test
public void testGetTmResourceParamsConfigs() throws Exception {
- String[] commands = {RUN_BASH_JAVA_UTILS_CMD_SCRIPT,
BashJavaUtils.Command.GET_TM_RESOURCE_PARAMS.toString()};
+ int expectedResultLines = 2;
+ String[] commands = {RUN_BASH_JAVA_UTILS_CMD_SCRIPT,
BashJavaUtils.Command.GET_TM_RESOURCE_PARAMS.toString(),
String.valueOf(expectedResultLines)};
List<String> lines =
Arrays.asList(executeScript(commands).split(System.lineSeparator()));
- assertEquals(2, lines.size());
+ assertEquals(expectedResultLines, lines.size());
ConfigurationUtils.parseJvmArgString(lines.get(0));
ConfigurationUtils.parseTmResourceDynamicConfigs(lines.get(1));
}
+
+ @Test
+ public void testExtractLoggingOutputs() throws Exception {
+ StringBuilder input = new StringBuilder();
+ List<String> expectedOutput = new ArrayList<>();
+
+ for (int i = 0; i < 5; ++i) {
+ String line = "BashJavaUtils output line " + i;
Review comment:
maybe add some special symbols (e.g. " , ' , \ , /) to make sure the arg
`expected_lines` is correctly taken by `extractLoggingOutputs` as it comes
after `output`.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services