abstractdog commented on code in PR #521:
URL: https://github.com/apache/tez/pull/521#discussion_r3623478982


##########
tez-tests/src/test/java/org/apache/tez/mapreduce/TestMRRJobsDAGApi.java:
##########
@@ -400,16 +400,24 @@ public void testAMRelocalization() throws Exception {
     additionalResources.put("test.jar", createLrObjFromPath(relocFilePath));
     additionalResources.put("TezAppJar.jar", 
createLrObjFromPath(tezAppJarRemote));
 
-    assertEquals(TezAppMasterStatus.READY, tezSession.getAppMasterStatus());
+    waitForSessionReady(tezSession);
     finalState = testMRRSleepJobDagSubmitCore(true, false, false,
         tezSession, true, MRInputAMSplitGeneratorRelocalizationTest.class, 
additionalResources);
     assertEquals(DAGStatus.State.SUCCEEDED, finalState);
-    assertEquals(TezAppMasterStatus.READY, tezSession.getAppMasterStatus());
+    waitForSessionReady(tezSession);
     assertTrue(remoteFs.exists(new Path("/tmp/relocalizationfilefound")));
 
     stopAndVerifyYarnApp(tezSession);
   }
 
+  private void waitForSessionReady(TezClient tezSession)

Review Comment:
   this method waits + asserts, which doesn't seem to be inline with the name 
`waitForSessionReady, please rename it accordingly



##########
tez-tests/src/test/java/org/apache/tez/mapreduce/TestMRRJobsDAGApi.java:
##########
@@ -400,16 +400,24 @@ public void testAMRelocalization() throws Exception {
     additionalResources.put("test.jar", createLrObjFromPath(relocFilePath));
     additionalResources.put("TezAppJar.jar", 
createLrObjFromPath(tezAppJarRemote));
 
-    assertEquals(TezAppMasterStatus.READY, tezSession.getAppMasterStatus());
+    waitForSessionReady(tezSession);
     finalState = testMRRSleepJobDagSubmitCore(true, false, false,
         tezSession, true, MRInputAMSplitGeneratorRelocalizationTest.class, 
additionalResources);
     assertEquals(DAGStatus.State.SUCCEEDED, finalState);
-    assertEquals(TezAppMasterStatus.READY, tezSession.getAppMasterStatus());
+    waitForSessionReady(tezSession);
     assertTrue(remoteFs.exists(new Path("/tmp/relocalizationfilefound")));
 
     stopAndVerifyYarnApp(tezSession);
   }
 
+  private void waitForSessionReady(TezClient tezSession)
+      throws IOException, TezException, InterruptedException {
+    boolean ready = tezSession.waitTillReady(60, TimeUnit.SECONDS);

Review Comment:
   if we're talking about a short period between DAG succeed and session READY, 
isn't 60 seconds an overkill?



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to