From a67a0fd37a55bb015b36b072405dec8ea11c7c67 Mon Sep 17 00:00:00 2001 From: Steve Loughran Date: Thu, 5 Aug 2021 11:34:10 +0100 Subject: [PATCH] YARN-10878. move TestNMSimulator off com.google (#3268) Converting from a class to a lambda-expression removes all need to reference the google stuff Contributed by Steve Loughran --- .../yarn/sls/nodemanager/TestNMSimulator.java | 22 +++++++------------ 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/hadoop-tools/hadoop-sls/src/test/java/org/apache/hadoop/yarn/sls/nodemanager/TestNMSimulator.java b/hadoop-tools/hadoop-sls/src/test/java/org/apache/hadoop/yarn/sls/nodemanager/TestNMSimulator.java index f82ce916e1..6f7ff17924 100644 --- a/hadoop-tools/hadoop-sls/src/test/java/org/apache/hadoop/yarn/sls/nodemanager/TestNMSimulator.java +++ b/hadoop-tools/hadoop-sls/src/test/java/org/apache/hadoop/yarn/sls/nodemanager/TestNMSimulator.java @@ -157,13 +157,10 @@ public void testNMSimAppAddedAndRemoved() throws Exception { numClusterNodes = rm.getResourceScheduler().getNumClusterNodes(); } - GenericTestUtils.waitFor(new com.google.common.base.Supplier() { - @Override - public Boolean get() { - return rm.getResourceScheduler().getRootQueueMetrics() - .getAvailableMB() > 0; - } - }, 500, 10000); + GenericTestUtils.waitFor(() -> + rm.getResourceScheduler().getRootQueueMetrics() + .getAvailableMB() > 0, + 500, 10000); Assert.assertEquals("Node should have no runningApps.", node.getNode().getRunningApps().size(), 0); @@ -207,13 +204,10 @@ public void testNMSimNullAppAddedAndRemoved() throws Exception { numClusterNodes = rm.getResourceScheduler().getNumClusterNodes(); } - GenericTestUtils.waitFor(new com.google.common.base.Supplier() { - @Override - public Boolean get() { - return rm.getResourceScheduler().getRootQueueMetrics() - .getAvailableMB() > 0; - } - }, 500, 10000); + GenericTestUtils.waitFor(() -> + rm.getResourceScheduler().getRootQueueMetrics() + .getAvailableMB() > 0, + 500, 10000); Assert.assertEquals("Node should have no runningApps.", node.getNode().getRunningApps().size(), 0);