Skip to content

Commit

Permalink
[FLINK-37083][e2e] Fix failed SqlYARNApplicationITCase on AZP (#25936)
Browse files Browse the repository at this point in the history
  • Loading branch information
fsk119 authored Jan 13, 2025
1 parent c730292 commit 3a2e6a0
Showing 1 changed file with 15 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -86,14 +86,24 @@ void testDeployScriptViaSqlClient() throws Exception {
}

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"));
Expand All @@ -109,6 +119,8 @@ private void runSqlClient() throws Exception {
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());
Expand Down

0 comments on commit 3a2e6a0

Please sign in to comment.