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
This commit is contained in:
Steve Loughran 2021-08-05 11:34:10 +01:00 committed by GitHub
parent 3450522c2f
commit a67a0fd37a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 14 deletions

View File

@ -157,13 +157,10 @@ public class TestNMSimulator {
numClusterNodes = rm.getResourceScheduler().getNumClusterNodes(); numClusterNodes = rm.getResourceScheduler().getNumClusterNodes();
} }
GenericTestUtils.waitFor(new com.google.common.base.Supplier<Boolean>() { GenericTestUtils.waitFor(() ->
@Override rm.getResourceScheduler().getRootQueueMetrics()
public Boolean get() { .getAvailableMB() > 0,
return rm.getResourceScheduler().getRootQueueMetrics() 500, 10000);
.getAvailableMB() > 0;
}
}, 500, 10000);
Assert.assertEquals("Node should have no runningApps.", Assert.assertEquals("Node should have no runningApps.",
node.getNode().getRunningApps().size(), 0); node.getNode().getRunningApps().size(), 0);
@ -207,13 +204,10 @@ public class TestNMSimulator {
numClusterNodes = rm.getResourceScheduler().getNumClusterNodes(); numClusterNodes = rm.getResourceScheduler().getNumClusterNodes();
} }
GenericTestUtils.waitFor(new com.google.common.base.Supplier<Boolean>() { GenericTestUtils.waitFor(() ->
@Override rm.getResourceScheduler().getRootQueueMetrics()
public Boolean get() { .getAvailableMB() > 0,
return rm.getResourceScheduler().getRootQueueMetrics() 500, 10000);
.getAvailableMB() > 0;
}
}, 500, 10000);
Assert.assertEquals("Node should have no runningApps.", Assert.assertEquals("Node should have no runningApps.",
node.getNode().getRunningApps().size(), 0); node.getNode().getRunningApps().size(), 0);