[ https://issues.apache.org/jira/browse/FLINK-10527?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16658358#comment-16658358 ]
ASF GitHub Bot commented on FLINK-10527: ---------------------------------------- tillrohrmann closed pull request #6816: [FLINK-10527] Cleanup constant isNewMode in YarnTestBase URL: https://github.com/apache/flink/pull/6816 This is a PR merged from a forked repository. As GitHub hides the original diff on merge, it is displayed below for the sake of provenance: As this is a foreign pull request (from a fork), the diff is supplied below (as it won't show otherwise due to GitHub magic): diff --git a/flink-yarn-tests/src/test/java/org/apache/flink/yarn/YARNSessionFIFOITCase.java b/flink-yarn-tests/src/test/java/org/apache/flink/yarn/YARNSessionFIFOITCase.java index f027399be7f..fb2c6ccf2b0 100644 --- a/flink-yarn-tests/src/test/java/org/apache/flink/yarn/YARNSessionFIFOITCase.java +++ b/flink-yarn-tests/src/test/java/org/apache/flink/yarn/YARNSessionFIFOITCase.java @@ -132,28 +132,6 @@ public void testDetachedMode() throws InterruptedException, IOException { // before checking any strings outputted by the CLI, first give it time to return clusterRunner.join(); - if (!isNewMode) { - checkForLogString("The Flink YARN client has been started in detached mode"); - - // in legacy mode we have to wait until the TMs are up until we can submit the job - LOG.info("Waiting until two containers are running"); - // wait until two containers are running - while (getRunningContainers() < 2) { - sleep(500); - } - - // additional sleep for the JM/TM to start and establish connection - long startTime = System.nanoTime(); - while (System.nanoTime() - startTime < TimeUnit.NANOSECONDS.convert(10, TimeUnit.SECONDS) && - !(verifyStringsInNamedLogFiles( - new String[]{"YARN Application Master started"}, "jobmanager.log") && - verifyStringsInNamedLogFiles( - new String[]{"Starting TaskManager actor"}, "taskmanager.log"))) { - LOG.info("Still waiting for JM/TM to initialize..."); - sleep(500); - } - } - // actually run a program, otherwise we wouldn't necessarily see any TaskManagers // be brought up Runner jobRunner = startWithArgs(new String[]{"run", @@ -163,14 +141,12 @@ public void testDetachedMode() throws InterruptedException, IOException { jobRunner.join(); - if (isNewMode) { - // in "new" mode we can only wait after the job is submitted, because TMs - // are spun up lazily - LOG.info("Waiting until two containers are running"); - // wait until two containers are running - while (getRunningContainers() < 2) { - sleep(500); - } + // in "new" mode we can only wait after the job is submitted, because TMs + // are spun up lazily + LOG.info("Waiting until two containers are running"); + // wait until two containers are running + while (getRunningContainers() < 2) { + sleep(500); } // make sure we have two TMs running in either mode ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > Cleanup constant isNewMode in YarnTestBase > ------------------------------------------ > > Key: FLINK-10527 > URL: https://issues.apache.org/jira/browse/FLINK-10527 > Project: Flink > Issue Type: Sub-task > Components: YARN > Reporter: vinoyang > Assignee: vinoyang > Priority: Major > Labels: pull-request-available > > This seems to be a residual problem with FLINK-10396. It is set to true in > that PR. Currently it has three usage scenarios: > 1. assert, caused an error > {code:java} > assumeTrue("The new mode does not start TMs upfront.", !isNewMode); > {code} > 2. if (!isNewMode) the logic in the block would not have invoked, the if > block can be removed > 3. if (isNewMode) always been invoked, the if statement can be removed. -- This message was sent by Atlassian JIRA (v7.6.3#76005)