This is an automated email from the ASF dual-hosted git repository. shengkai pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/flink.git
The following commit(s) were added to refs/heads/master by this push: new 3a2e6a0279c [FLINK-37083][e2e] Fix failed SqlYARNApplicationITCase on AZP (#25936) 3a2e6a0279c is described below commit 3a2e6a0279cdaa68e4e5a3c47b50a36eaef882ab Author: Shengkai <33114724+fsk...@users.noreply.github.com> AuthorDate: Mon Jan 13 09:33:46 2025 +0800 [FLINK-37083][e2e] Fix failed SqlYARNApplicationITCase on AZP (#25936) --- .../apache/flink/yarn/SqlYARNApplicationITCase.java | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/flink-yarn-tests/src/test/java/org/apache/flink/yarn/SqlYARNApplicationITCase.java b/flink-yarn-tests/src/test/java/org/apache/flink/yarn/SqlYARNApplicationITCase.java index 282e297c35f..70fecd0a7ec 100644 --- a/flink-yarn-tests/src/test/java/org/apache/flink/yarn/SqlYARNApplicationITCase.java +++ b/flink-yarn-tests/src/test/java/org/apache/flink/yarn/SqlYARNApplicationITCase.java @@ -86,14 +86,24 @@ public class SqlYARNApplicationITCase extends YarnTestBase { } private void runSqlClient() throws Exception { - Path path = flinkLibFolder.getParentFile().toPath().resolve("bin").resolve("sql-client.sh"); - if (!path.toFile().exists()) { + File sqlClientScript = + new File( + flinkLibFolder + .getParentFile() + .toPath() + .resolve("bin") + .resolve("sql-client.sh") + .toUri()); + if (!sqlClientScript.exists()) { throw new RuntimeException(); + } else { + // make sure the subprocess has permission to execute the file. + Runtime.getRuntime().exec("chmod +x " + sqlClientScript.getCanonicalPath()).waitFor(); } List<String> parameters = new ArrayList<>(); // command line parameters: sql-client.sh -Dkey=value -f <path-to-script> - parameters.add(path.toString()); + parameters.add(sqlClientScript.getCanonicalPath()); parameters.add( getSqlClientParameter(JobManagerOptions.TOTAL_PROCESS_MEMORY.key(), "768MB")); parameters.add(getSqlClientParameter(TaskManagerOptions.TOTAL_PROCESS_MEMORY.key(), "1g")); @@ -109,6 +119,8 @@ public class SqlYARNApplicationITCase extends YarnTestBase { parameters.add("-f"); parameters.add(script.getAbsolutePath()); + LOG.info("Running process with parameters: {}", parameters); + ProcessBuilder builder = new ProcessBuilder(parameters); // prepare environment builder.environment().put("HADOOP_CLASSPATH", getYarnClasspath());