Przeglądaj źródła

YARN-9404. TestApplicationLifetimeMonitor#testApplicationLifetimeMonitor fails intermittent. Contributed by Prabhu Joseph.

Giovanni Matteo Fumarola 6 lat temu
rodzic
commit
509b20b292

+ 3 - 4
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/rmapp/TestApplicationLifetimeMonitor.java

@@ -204,13 +204,12 @@ public class TestApplicationLifetimeMonitor {
         // app4 submitted exceeding queue max lifetime,
         // so killed after queue max lifetime.
         rm.waitForState(app4.getApplicationId(), RMAppState.KILLED);
-        long totalTimeRun =
-            (app4.getFinishTime() - app4.getSubmitTime()) / 1000;
+        long totalTimeRun = app4.getFinishTime() - app4.getSubmitTime();
         Assert.assertTrue("Application killed before lifetime value",
-            totalTimeRun > maxLifetime);
+            totalTimeRun > (maxLifetime * 1000));
         Assert.assertTrue(
             "Application killed before lifetime value " + totalTimeRun,
-            totalTimeRun < maxLifetime + 10L);
+            totalTimeRun < ((maxLifetime + 10L) * 1000));
       }
     } finally {
       stopRM(rm);