YARN-7860. Fix UT failure TestRMWebServiceAppsNodelabel#testAppsRunning. Contributed by Sunil G.
(cherry picked from commit bff858e910f69991e6c75151d9b89c3e78210f16)
This commit is contained in:
parent
e56f2d4993
commit
c351230d0e
@ -217,13 +217,18 @@ private String getResource(int memory, int vcore) {
|
||||
|
||||
private void verifyResource(JSONObject partition, String partitionName,
|
||||
String amused, String used, String reserved) throws JSONException {
|
||||
JSONObject amusedObject = (JSONObject) partition.get("amUsed");
|
||||
JSONObject usedObject = (JSONObject) partition.get("used");
|
||||
JSONObject reservedObject = (JSONObject) partition.get("reserved");
|
||||
assertEquals("Partition expected", partitionName,
|
||||
partition.get("partitionName"));
|
||||
assertEquals("partition amused", amused,
|
||||
partition.get("amUsed").toString());
|
||||
assertEquals("partition used", used, partition.get("used").toString());
|
||||
assertEquals("partition amused", amused, getResource(
|
||||
(int) amusedObject.get("memory"), (int) amusedObject.get("vCores")));
|
||||
assertEquals("partition used", used, getResource(
|
||||
(int) usedObject.get("memory"), (int) usedObject.get("vCores")));
|
||||
assertEquals("partition reserved", reserved,
|
||||
partition.get("reserved").toString());
|
||||
getResource((int) reservedObject.get("memory"),
|
||||
(int) reservedObject.get("vCores")));
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
|
Loading…
x
Reference in New Issue
Block a user